]>
Commit | Line | Data |
---|---|---|
ba584e6e | 1 | #!/bin/bash |
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 | export PATH=/bin:/sbin:/usr/bin:/usr/sbin | |
8 | ||
9 | # Source function library. | |
10 | . /etc/rc.d/init.d/functions | |
11 | ||
12 | # Source networking configuration. | |
13 | . /etc/sysconfig/network | |
14 | ||
15 | # Demon specified configuration. | |
16 | . /etc/sysconfig/samba | |
17 | ||
18 | # Check that networking is up. | |
19 | [ "${NETWORKING}" = "no" ] && exit 0 | |
20 | ||
21 | # Check that smb.conf exists. | |
22 | [ -f /etc/samba/smb.conf ] || exit 0 | |
23 | ||
24 | # See how we were called. | |
25 | case "$1" in | |
26 | start) | |
27 | show Starting smbd | |
28 | daemon $NICELEVEL smbd -D | |
29 | show Starting nmbd | |
30 | daemon $NICELEVEL nmbd -D | |
31 | touch /var/lock/subsys/smb | |
32 | ;; | |
33 | stop) | |
34 | show Shutting down smbd | |
35 | killproc smbd | |
36 | show Shutting down nmbd | |
37 | killproc nmbd | |
38 | rm -f /var/lock/subsys/smb | |
39 | ;; | |
40 | status) | |
41 | status smbd | |
42 | status nmbd | |
43 | smbstatus | |
44 | ;; | |
45 | restart) | |
46 | $0 stop | |
47 | $0 start | |
48 | ;; | |
49 | *) | |
50 | echo "Usage: $0 {start|stop|restart|status}" | |
51 | exit 1 | |
52 | esac | |
53 |