-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshitstart
executable file
·51 lines (45 loc) · 1.01 KB
/
shitstart
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
#!/bin/sh
### BEGIN INIT INFO
# Provides: shitstart
# Required-Start: hostname $local_fs
# Required-Stop:
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Startup of InternetOfShit
# Description: This script starts/stops InternetOfShit.
### END INIT INFO
export PATH=$PATH:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
. /lib/init/vars.sh
ADC_LOG=/adc_server.log
SHIT_LOG=/tmp/shitapp.log
if [ $( id -u ) != 0 ]; then
echo "ERROR: Must be run as root"
exit 1
fi
case "$1" in
start)
echo "Starting ADC server..."
/usr/local/sbin/adc_server -t 1 >$ADC_LOG &
sleep 2
echo "Starting InternetOfShit app..."
/usr/local/sbin/shitapp >$SHIT_LOG &
echo "Service started"
;;
restart|reload|force-reload)
killall adc_server
killall shitapp
/usr/local/sbin/adc_server >$ADC_LOG
sleep 2
/usr/local/sbin/shitapp >$SHIT_LOG
;;
stop)
killall adc_server
killall node
;;
*)
echo "Usage: shitstart [start|stop|restart]" >&2
exit 6
;;
esac
exit 0