wok view ajaxterm/stuff/etc/init.d/ajaxterm @ rev 17005

Add pulseaudio
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Aug 12 13:55:28 2014 +0200 (2014-08-12)
parents 4da64a9e2232
children 7f188676b59c
line source
1 #!/bin/sh
2 # /etc/init.d/ajaxterm : Start, stop and restart AjaxTerm server on SliTaz, at
3 # boot time or with the command line.
4 #
5 # To start AjaxTerm server at boot time, just put ajaxterm in the $RUN_DAEMONS
6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
7 #
8 . /etc/init.d/rc.functions
9 . /etc/daemons.conf
11 NAME=AjaxTerm
12 DESC="AjaxTerm server"
13 DAEMON="/usr/share/ajaxterm/ajaxterm.py"
14 OPTIONS=$AJAXTERM_OPTIONS
15 PIDFILE=/var/run/ajaxterm.pid
16 [ -n "$OPTIONS" ] || OPTIONS="--pidfile $PIDFILE --daemon --port=8022 --command=/usr/share/ajaxterm/login"
17 export PYTHONPATH=/usr/share/ajaxterm
19 case "$1" in
20 start)
21 if active_pidfile $PIDFILE python ; then
22 echo "$NAME already running."
23 exit 1
24 fi
25 echo -n "Starting $DESC: $NAME... "
26 $DAEMON $OPTIONS
27 status
28 sleep 2
29 ;;
30 stop)
31 if ! active_pidfile $PIDFILE python ; then
32 echo "$NAME is not running."
33 exit 1
34 fi
35 echo -n "Stopping $DESC: $NAME... "
36 kill `cat $PIDFILE`
37 status
38 rm -f $PIDFILE
39 sleep 2
40 ;;
41 restart)
42 if ! active_pidfile $PIDFILE python ; then
43 echo "$NAME is not running."
44 exit 1
45 fi
46 echo -n "Restarting $DESC: $NAME... "
47 kill `cat $PIDFILE`
48 rm -f $PIDFILE
49 sleep 2
50 $DAEMON $OPTIONS
51 status
52 sleep 2
53 ;;
54 *)
55 echo ""
56 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
57 echo ""
58 exit 1
59 ;;
60 esac
62 exit 0