open-plc-utils: new package
[buildroot-gz.git] / package / samba / S91smb
blobc190771b7de280cdf5c8b26c61d9d6f5b33ffd9e
1 #!/bin/sh
3 # Stolen from RedHat FC5.
6 # Check that smb.conf exists.
7 [ -f /etc/samba/smb.conf ] || exit 0
9 # Make directories.
10 mkdir -p /var/cache/samba
11 mkdir -p /var/log/samba
12 mkdir -p /var/lock/subsys
14 RETVAL=0
16 start() {
17 echo -n "Starting SMB services: "
18 smbd -D
19 RETVAL=$?
20 echo "done"
22 echo -n "Starting NMB services: "
23 nmbd -D
24 RETVAL2=$?
25 echo "done"
27 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/smb || \
28 RETVAL=1
29 return $RETVAL
32 stop() {
33 echo -n "Shutting down SMB services: "
34 kill -9 `pidof smbd`
35 RETVAL=$?
36 rm -f /var/run/smbd.pid
37 echo "done"
39 echo -n "Shutting down NMB services: "
40 kill -9 `pidof nmbd`
41 RETVAL2=$?
42 rm -f /var/run/nmbd.pid
44 [ $RETVAL -eq 0 -a $RETVAL2 -eq 0 ] && rm -f /var/lock/subsys/smb
45 echo "done"
46 return $RETVAL
49 restart() {
50 stop
51 start
54 reload() {
55 echo -n "Reloading smb.conf file: "
56 kill -HUP `pidof smbd`
57 RETVAL=$?
58 echo "done"
59 return $RETVAL
62 case "$1" in
63 start)
64 start
66 stop)
67 stop
69 restart)
70 restart
72 reload)
73 reload
76 echo "Usage: $0 {start|stop|restart|reload}"
77 exit 1
78 esac
80 exit $?