1
0
mirror of https://github.com/agdsn/ancient-weatherstation.git synced 2026-06-19 14:58:00 +00:00
Files
ancient-weatherstation/deamon/init/weatherd
T
losinshi ec60e691f4 bugfixes
git-svn-id: file:///home/jan/tmp/wetterstation/trunk@176 dd492736-c11a-0410-ad51-8c26713eaf7f
2006-09-27 23:19:27 +00:00

41 lines
691 B
Bash
Executable File

#!/bin/sh
binary='/usr/bin/weatherdeamon';
user='weatherstation'
group='weatherstation'
check_status()
{
if [ $? = 0 ]
then
echo "OK"
else
echo "FAILED"
return=$rc_failed
fi
}
return=$rc_done
case "$1" in
start)
echo -n "Starting Weather - daemon..."
/sbin/start-stop-daemon --start -q --chuid $user --group $group --exec $binary
check_status
;;
stop)
echo -n "Stopping Weather - daemon..."
/sbin/start-stop-daemon --stop -q --exec $binary
check_status
;;
restart)
$0 stop && $0 start || return=$rc_failed
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
test "$return" = "$rc_done" || exit 1
exit 0