source: freewrt/package/samba/files/samba.init@ 583d755

freewrt_1_0 freewrt_2_0
Last change on this file since 583d755 was 583d755, checked in by Thorsten Glaser <tg@…>, 19 years ago
  • change the SYSV init system to add a target "autostart"
  • on system startup, call autostart instead of start
  • on autostart, check /etc/rc.conf for whether the service is enabled and act appropriately; fall through into start target
  • move some pre-startup checks into the start target
  • some whitespace cleanup, when it makes much sense (XXX when I get the person who wrote these scripts...)
  • optimise dropbear a little

ok and approved wbx@

git-svn-id: svn://www.freewrt.org/trunk/freewrt@191 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 410 bytes
Line 
1#!/bin/sh
2
3DEFAULT=/etc/default/samba
4RUN_D=/var/run/samba
5NMBD_PID_F=$RUN_D/nmbd.pid
6SMBD_PID_F=$RUN_D/smbd.pid
7[ -f $DEFAULT ] && . $DEFAULT
8
9case $1 in
10autostart|start)
11 mkdir -p $RUN_D
12 nmbd -D $NMBD_OPTIONS
13 smbd -D $SMBD_OPTIONS
14 ;;
15 stop)
16 [ -f $SMBD_PID_F ] && kill $(cat $SMBD_PID_F)
17 [ -f $NMBD_PID_F ] && kill $(cat $NMBD_PID_F)
18 ;;
19 *)
20 echo "usage: $0 (start|stop)"
21 exit 1
22esac
23
24exit $?
Note: See TracBrowser for help on using the repository browser.