Changed sunset calculation parameters. Added init script

for Debian and adaptions of tellstickd. All contributions of Anders Betner.
This commit is contained in:
Magnus Juntti 2008-02-18 21:34:06 +00:00
parent 9359c895a2
commit fb980ff35a
2 changed files with 75 additions and 0 deletions

View file

@ -35,6 +35,7 @@ Bug reports are welcome, but even more appreciated are patches with the solution
Revision history
=================
2008-02-18 0.3.5 Changed sunset calculation parameters. Added init script for Debian and adaptions of tellstickd. All contributions of Anders Betner.
2008-02-17 0.3.4 Now possible to use a minus sign (-) when setting <off when bright delay> and <prelight in afternoon>
2008-02-15 0.3.3 General improvements.
2008-02-15 0.3.2 Corrected a fatal bug regarding switch logic.

View file

@ -0,0 +1,74 @@
#!/bin/bash
#
# Init file for tellstickd remote light switch daemon
#
# Written by Magnus Juntti
#
# chkconfig: 35 54 46
# description: tellstickd remote light switch daemon
#
# processname: tellstickd
# config: /etc/tellstickd.conf
# pidfile: /var/run/tellstick
. /lib/lsb/init-functions
DAEMON="/usr/local/bin/tellstickd"
NAME="tellstickd"
CONFIG_FILE="/etc/tellstickd.conf"
LOG_FILE="/var/log/tellstickd"
PID_FILE="/var/run/tellstickd.pid"
OPTIONS=""
[ -x $DAEMON ] || exit 1
[ -r $CONFIG_FILE ] || exit 1
RETVAL=0
prog="tellstickd"
desc="remote switch daemon"
start() {
log_begin_msg "Starting $desc ($prog): "
start-stop-daemon --start --quiet --pidfile "$PID_FILE" --name $NAME --exec $DAEMON -- --daemon --config $CONFIG_FILE --logfile $LOG_FILE $OPTIONS
log_end_msg $?
}
stop() {
log_begin_msg "Shutting down $desc ($prog): "
start-stop-daemon --stop --quiet --pidfile "$PID_FILE" --name $NAME
log_end_msg $?
}
restart() {
stop
start
}
reload() {
log_begin_msg "Reloading $desc ($prog): "
start-stop-daemon --stop --quiet --pidfile "$PID_FILE" --name $NAME --signal 1
log_end_msg $?
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
*)
echo $"Usage: $0 {start|stop|restart|reload}"
RETVAL=1
esac
exit $RETVAL