first pass at updating head branch to be to be the same as the SAMBA_2_0 branch
[kai/samba.git] / packaging / Caldera / smb.init
1 #!/bin/sh
2 #
3 # description: Starts and stops the Samba smbd and nmbd daemons \
4 #              used to provide SMB network services.
5
6 # Source function library.
7 . /etc/rc.d/init.d/functions
8
9 # Source networking configuration.
10 . /etc/sysconfig/network
11
12 # Check that networking is up.
13 [ ${NETWORKING} = "no" ] && exit 0
14
15 # Check that smb.conf exists.
16 [ -f /etc/smb.conf ] || exit 0
17
18 # See how we were called.
19 case "$1" in
20   start)
21         echo -n "Starting SMB services: "
22         smbd -D         
23         nmbd -D 
24         echo
25         touch /var/lock/subsys/smb
26         ;;
27   stop)
28         echo -n "Shutting down SMB services: "
29         killproc smbd
30         killproc nmbd
31         rm -f /var/lock/subsys/smb
32         echo ""
33         ;;
34   status)
35         status smbd
36         status nmbd
37         ;;
38   restart)
39         echo -n "Restarting SMB services: "
40         $0 stop
41         $0 start
42         echo "done."
43         ;;
44   *)
45         echo "Usage: smb {start|stop|restart|status}"
46         exit 1
47 esac
48