-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathssmb
46 lines (42 loc) · 1.05 KB
/
ssmb
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
#!/bin/bash
### BEGIN INIT INFO
# Provides: ssmb
# Required-Start: $local_fs $network $remote_fs $named $time
# Required-Stop: $local_fs $network $remote_fs $named
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Halts ssmb...
### END INIT INFO
# adjust the variables section below
#
# then: place this in /etc/init.d
# then: chmod +x /etc/init.d/ssmb
# then: update-rc.d ssmb defaults
#
# start daemon with /etc/init.d/ssmb start
# stop it with /etc/init.d/ssmb stop
DAEMON=/usr/bin/python3
ARGS=home/pi/ssmb/ssmb.py
LOG=/home/pi/ssmb/sonos-marantz-bridge.log
PIDFILE=/var/run/ssmb.pid
USER=pi
GROUP=pi
case "$1" in
start)
echo "Starting server"
/sbin/start-stop-daemon --start --pidfile $PIDFILE \
--user $USER --group $GROUP \
-b --make-pidfile \
--chuid $USER \
--startas /bin/bash -- -c "exec $DAEMON $ARGS >>$LOG 2>&1"
;;
stop)
echo "Stopping server"
/sbin/start-stop-daemon --stop --pidfile $PIDFILE --verbose
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
;;
esac
exit 0