]> git.pld-linux.org Git - packages/samba.git/blob - smb.init
- replaced #!/non/bash by #!/bin/sh (this script is pure POSIX sh),
[packages/samba.git] / smb.init
1 #!/bin/sh
2 #
3 # chkconfig:    345 91 35
4 # description:  Starts and stops the Samba smbd and nmbd daemons \
5 #               used to provide SMB network services.
6 #
7 # config:       /etc/samba/smb.conf
8 # config:       /etc/samba/lmhosts
9
10 export PATH=/bin:/sbin:/usr/bin:/usr/sbin
11
12 # Source function library.
13 . /etc/rc.d/init.d/functions
14
15 # Source networking configuration.
16 . /etc/sysconfig/network
17
18 # Demon specified configuration.
19 . /etc/sysconfig/samba
20
21 # Check that networking is up.
22 [ "${NETWORKING}" = "no" ] && exit 0
23
24 # Check that smb.conf exists.
25 [ -f /etc/samba/smb.conf ] || exit 0
26
27 # See how we were called.
28 case "$1" in
29   start)
30         show Starting smbd
31         daemon $NICELEVEL smbd -D       
32         show Starting nmbd
33         daemon $NICELEVEL nmbd -D 
34         touch /var/lock/subsys/smb
35         ;;
36   stop)
37         show Shutting down smbd
38         killproc smbd
39         show Shutting down nmbd
40         killproc nmbd
41         rm -f /var/lock/subsys/smb
42         ;;
43   status)
44         status smbd
45         status nmbd
46         smbstatus
47         ;;
48   restart)
49         $0 stop
50         $0 start
51         ;;
52   *)
53         echo "Usage: $0 {start|stop|restart|status}"
54         exit 1
55 esac
56
This page took 0.057772 seconds and 4 git commands to generate.