blob: a1cf5ce7e9b4d872a81a0affc7cc96fe794f802b (
plain)
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
|
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: gateone
# Required-Start: networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Gateone HTML5 ssh client
# Description: Gateone HTML5 terminal emulator and SSH client.
### END INIT INFO
. /etc/init.d/functions
NAME=gateone
DAEMON=/var/lib/gateone/gateone.py
PIDFILE=/var/run/gateone.pid
WORKDIR=/var/lib/gateone
do_start() {
cd $WORKDIR
/usr/bin/python $DAEMON > /dev/null 2>&1 &
cd $OLDPWD
}
do_stop() {
kill -TERM `cat $PIDFILE`
}
case "$1" in
start)
echo "Starting gateone"
do_start
;;
stop)
echo "Stopping gateone"
do_stop
;;
restart|force-reload)
echo "Restart gateone"
do_stop
sleep 1
do_start
;;
*)
echo "Usage: $0 {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
|