diff options
author | root <root@krebs> | 2011-06-29 21:06:16 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-06-29 21:06:16 +0200 |
commit | 2a58f1af8074963ccbeec13a10811fefe2ceb113 (patch) | |
tree | 920989e9eb524319c1d3175adef4cf6db95acd76 /evan/evan-startup | |
parent | e88f09130eb0d642826cb50ff8a969cbfff7a721 (diff) |
added evan script
evan: espeak sublimal messages, -d for daemonization (in while loop with random delay)
evan-startup: startup script for init.d (does the totally right thing on debian
satz-liste: contains the list of things to be espeaked
Makefile: do make infest for the right thing
Diffstat (limited to 'evan/evan-startup')
-rwxr-xr-x | evan/evan-startup | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/evan/evan-startup b/evan/evan-startup new file mode 100755 index 00000000..a3370bd1 --- /dev/null +++ b/evan/evan-startup @@ -0,0 +1,73 @@ +#! /bin/sh +# +### BEGIN INIT INFO +# Provides: evan +# Required-Start: $remote_fs $network +# Required-Stop: $remote_fs $network +# Should-Start: $syslog $named +# Should-Stop: $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start evan daemons +# Description: + +### END INIT INFO +# +# Based on Lubomir Bulej's Redhat init script. + +DAEMON="/root/bin/evan" +PIDFILE="/var/lock/evan" +NAME="evan" +DESC="evan daemons" +TCONF="/etc/evan" + +test -f $DAEMON || exit 0 + +[ -r /etc/default/evan ] && . /etc/default/evan + + +start() { + [ -e $PIDFILE ] && echo "$PIDFILE already exists" && return + $DAEMON $EXTRA -d "$@" & + echo $(($$+1)) > $PIDFILE #TODO fix this ugly hack! +} +stop() { + [ ! -e $PIDFILE ] && echo "$PIDFILE does not exist" && return + kill `cat $PIDFILE` + rm $PIDFILE +} + +reload() { + echo "do nothing" + # do nothing +} + +restart() { + stop "$@" + start "$@" +} + +case "$1" in + start) + echo -n "Starting $DESC:" + start + ;; + stop) + echo -n "Stopping $DESC:" + stop + ;; + reload|force-reload) + echo -n "Reloading $DESC configuration:" + reload + ;; + restart) + echo -n "Restarting $DESC:" + restart + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|reload|restart|force-reload}" + exit 1 + ;; +esac +echo "done" +exit 0 |