-
Notifications
You must be signed in to change notification settings - Fork 47
/
S62smb
executable file
·60 lines (42 loc) · 945 Bytes
/
S62smb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
CONF="/etc/samba/smb.conf"
PROG="/usr/sbin/smbd"
PROG_N="/usr/sbin/nmbd"
test -x ${PROG} || exit 0
test -n "${OS_VERSION}" || source /etc/init.d/base
test -n "${OS_DEBUG}" || source /etc/init.d/conf
test -s ${CONF} || exit 0
start() {
mkdir -p /var/log/samba
mkdir -p /var/lib/samba/private
msg_begin "Starting smbd"
${PROG} -D
test $? == 0 && msg_done || msg_fail
msg_begin "Starting nmbd"
${PROG_N} -D
test $? == 0 && msg_done || msg_fail
}
stop() {
msg_begin "Stopping smbd"
killall -q $(basename ${PROG})
test $? == 0 && msg_done || msg_fail
msg_begin "Stopping nmbd"
killall -q $(basename ${PROG_N})
test $? == 0 && msg_done || msg_fail
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?