-
Notifications
You must be signed in to change notification settings - Fork 11
/
veejay
executable file
·41 lines (37 loc) · 987 Bytes
/
veejay
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
#!/bin/bash
# /etc/init.d/screensh
### BEGIN INIT INFO
# Provides: screen.sh
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Screen.sh
# Description: This runs a script continuously in screen.
### END INIT INFO
case "$1" in
start)
echo "Starting screen.sh"
screen -dm bash /root/wycliffe/spawn.sh
;;
stop)
echo "Stopping screen.sh"
PID=`ps -ef | grep spawn.sh | grep -v grep | awk '{print $2}'`
kill -9 $PID
;;
restart|force-reload)
echo "Restarting $screen"
PID=`ps -ef | grep spawn.sh | grep -v grep | awk '{print $2}'`
kill -9 $PID
sleep 15
screen -dm sh /root/wycliffe/spawn.sh
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart}" >&2
exit 1
;;
esac
exit 0