-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathpstk
executable file
·38 lines (35 loc) · 849 Bytes
/
pstk
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
#!/bin/sh
#/etc/init.d/pstk
#
# Boot time script to run picostack on debian-like system.
PICOSTACK=/usr/local/bin/picostk
GRP=www-data
USER=pstk
SUDO="/usr/bin/sudo -g $GRP -u $USER -i"
# Some things that run always
touch /var/lock/pstk
# Carry out specific functions when asked to by the system
case "$1" in
start)
echo "Starting script pstk "
$SUDO $PICOSTACK daemon start
echo "Starting sockify" # DEBUG=False in django settings!
$SUDO ${PICOSTACK}-sockify
;;
stop)
echo "Cleaning state of the system"
$SUDO $PICOSTACK clean all
echo "Stopping script pstk"
$SUDO $PICOSTACK daemon stop
echo "Stopping sockify"
pkill picostk-sockify
# blindly kill any left daemons
pkill picostk
pkill picostk
;;
*)
echo "Usage: /etc/init.d/pstk {start|stop}"
exit 1
;;
esac
exit 0