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