summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity/gateone/gateone/gateone-init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-connectivity/gateone/gateone/gateone-init')
-rw-r--r--meta-oe/recipes-connectivity/gateone/gateone/gateone-init47
1 files changed, 47 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/gateone/gateone/gateone-init b/meta-oe/recipes-connectivity/gateone/gateone/gateone-init
new file mode 100644
index 000000000..a1cf5ce7e
--- /dev/null
+++ b/meta-oe/recipes-connectivity/gateone/gateone/gateone-init
@@ -0,0 +1,47 @@
1#!/bin/sh -e
2### BEGIN INIT INFO
3# Provides: gateone
4# Required-Start: networking
5# Default-Start: 2 3 4 5
6# Default-Stop: 0 1 6
7# Short-Description: Gateone HTML5 ssh client
8# Description: Gateone HTML5 terminal emulator and SSH client.
9### END INIT INFO
10
11. /etc/init.d/functions
12
13NAME=gateone
14DAEMON=/var/lib/gateone/gateone.py
15PIDFILE=/var/run/gateone.pid
16WORKDIR=/var/lib/gateone
17
18do_start() {
19 cd $WORKDIR
20 /usr/bin/python $DAEMON > /dev/null 2>&1 &
21 cd $OLDPWD
22}
23
24do_stop() {
25 kill -TERM `cat $PIDFILE`
26}
27
28case "$1" in
29 start)
30 echo "Starting gateone"
31 do_start
32 ;;
33 stop)
34 echo "Stopping gateone"
35 do_stop
36 ;;
37 restart|force-reload)
38 echo "Restart gateone"
39 do_stop
40 sleep 1
41 do_start
42 ;;
43 *)
44 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
45 exit 1
46 ;;
47esac