lib: strings: Simplify strcasecmp
[Samba.git] / packaging / LSB / samba.sh
blob99fa1b0117d82fcf067e5d20baa33d50d517637c
1 #!/bin/sh
3 # "$Id: samba.sh,v 1.2 2001/07/03 01:01:12 jra Exp $"
5 # SAMBA startup (init) script for LSB-compliant systems.
7 # Provides: smbd nmbd
8 # Required-Start: 3 5
9 # Required-Stop: 0 2 1 6
10 # Default-Start: 3 5
11 # Default-Stop: 0 2 1 6
12 # Description: Starts and stops the SAMBA smbd and nmbd daemons \
13 # used to provide SMB network services.
16 # Source LSB function library.
17 . /lib/lsb/init-functions
19 # Check that smb.conf exists.
20 if test ! -f /etc/samba/smb.conf; then
21 log_failure_msg "The smb.conf file does not exist."
22 exit 6
25 # Make sure that smbd and nmbd exist...
26 if test ! -f /usr/sbin/nmbd -o ! -f /usr/sbin/smbd; then
27 log_failure_msg "The nmbd and/or smbd daemons are not installed."
28 exit 5
31 # See how we were called.
32 case "$1" in
33 start)
34 start_daemon nmbd -D
35 start_daemon smbd -D
36 log_success_msg "Started SMB services."
39 stop)
40 killproc smbd
41 killproc nmbd
42 log_success_msg "Shutdown SMB services."
45 reload)
46 # smbd and nmbd automatically re-read the smb.conf file...
47 log_success_msg "Reload not necessary with SAMBA."
50 status)
51 if test -z "`pidofproc smbd`"; then
52 log_success_msg "smbd is not running."
53 else
54 log_success_msg "smbd is running."
56 if test -z "`pidofproc nmbd`"; then
57 log_success_msg "nmbd is not running."
58 else
59 log_success_msg "nmbd is running."
64 restart | force-reload)
65 $0 stop
66 $0 start
70 echo "Usage: smb {start|stop|reload|force-reload|restart|status}"
71 exit 1
73 esac
75 # Return "success"
76 exit 0
79 # End of "$Id: samba.sh,v 1.2 2001/07/03 01:01:12 jra Exp $".