fixed bad link noticed by Martin Schwenke
[Samba.git] / packaging / LSB / samba.sh
bloba97949de14bc4c612fe3636981990edb6e1bd949
1 #!/bin/sh
3 # SAMBA startup (init) script for LSB-compliant systems.
5 # Provides: smbd nmbd
6 # Required-Start: 3 5
7 # Required-Stop: 0 2 1 6
8 # Default-Start: 3 5
9 # Default-Stop: 0 2 1 6
10 # Description: Starts and stops the SAMBA smbd and nmbd daemons \
11 # used to provide SMB network services.
14 # Source LSB function library.
15 . /lib/lsb/init-functions
17 # Check that smb.conf exists.
18 if test ! -f /etc/samba/smb.conf; then
19 log_failure_msg "The smb.conf file does not exist."
20 exit 6
23 # Make sure that smbd and nmbd exist...
24 if test ! -f /usr/sbin/nmbd -o ! -f /usr/sbin/smbd; then
25 log_failure_msg "The nmbd and/or smbd daemons are not installed."
26 exit 5
29 # See how we were called.
30 case "$1" in
31 start)
32 start_daemon nmbd -D
33 start_daemon smbd -D
34 log_success_msg "Started SMB services."
37 stop)
38 killproc smbd
39 killproc nmbd
40 log_success_msg "Shutdown SMB services."
43 reload)
44 # smbd and nmbd automatically re-read the smb.conf file...
45 log_success_msg "Reload not necessary with SAMBA."
48 status)
49 if test -z "`pidofproc smbd`"; then
50 log_success_msg "smbd is not running."
51 else
52 log_success_msg "smbd is running."
54 if test -z "`pidofproc nmbd`"; then
55 log_success_msg "nmbd is not running."
56 else
57 log_success_msg "nmbd is running."
62 restart | force-reload)
63 $0 stop
64 $0 start
68 echo "Usage: smb {start|stop|reload|force-reload|restart|status}"
69 exit 1
71 esac
73 # Return "success"
74 exit 0