Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
[ira/wip.git] / packaging / Example / samba.init
1 #!/bin/sh
2 #
3 if [ ! -d /usr/bin ]; then
4         echo "The /usr file system is not mounted."
5         exit 1
6 fi
7
8 killproc() {         
9         pid=`/bin/ps ax | grep -w $1 | sed -e 's/^  *//' -e 's/ .*//'`
10         echo "Stopping $1 now."
11         [ "$pid" != "" ] && kill -15 $pid
12         echo $pid
13 }
14
15
16 # Start/stop processes required for samba server
17
18 case "$1" in
19
20         'start')
21            echo "Starting Samba"
22            /usr/local/samba/sbin/smbd
23            /usr/local/samba/sbin/nmbd
24            echo "Done."
25            ;;
26         'stop')
27            killproc smbd
28            killproc nmbd
29            ;;
30         *)
31            echo "Usage: /sbin/init.d/samba.init [ start | stop ]"
32            ;;
33 esac
34 exit 0