diff options
Diffstat (limited to 'meta-oe/recipes-connectivity/gateone/gateone/gateone-init')
-rw-r--r-- | meta-oe/recipes-connectivity/gateone/gateone/gateone-init | 47 |
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 | |||
13 | NAME=gateone | ||
14 | DAEMON=/var/lib/gateone/gateone.py | ||
15 | PIDFILE=/var/run/gateone.pid | ||
16 | WORKDIR=/var/lib/gateone | ||
17 | |||
18 | do_start() { | ||
19 | cd $WORKDIR | ||
20 | /usr/bin/python $DAEMON > /dev/null 2>&1 & | ||
21 | cd $OLDPWD | ||
22 | } | ||
23 | |||
24 | do_stop() { | ||
25 | kill -TERM `cat $PIDFILE` | ||
26 | } | ||
27 | |||
28 | case "$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 | ;; | ||
47 | esac | ||