mirror of
https://github.com/agdsn/ancient-weatherstation.git
synced 2026-06-19 14:58:00 +00:00
init-script improved
git-svn-id: file:///home/jan/tmp/wetterstation/trunk@123 dd492736-c11a-0410-ad51-8c26713eaf7f
This commit is contained in:
+20
-2
@@ -1,14 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
binary='/home/jan/testwetter/sammeln/weatherdeamon';
|
||||
user='jan'
|
||||
group='jan'
|
||||
|
||||
check_status()
|
||||
{
|
||||
if [ $? = 0 ]
|
||||
then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAILED"
|
||||
return=$rc_failed
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
return=$rc_done
|
||||
case "$1" in
|
||||
start)
|
||||
/sbin/start-stop-daemon --start -v --exec $binary
|
||||
echo -n "Starting Weather - daemon..."
|
||||
/sbin/start-stop-daemon --start -q --chuid $user --group $group --exec $binary
|
||||
check_status
|
||||
;;
|
||||
stop)
|
||||
/sbin/start-stop-daemon --stop -v --exec $binary
|
||||
echo -n "Stopping Weather - daemon..."
|
||||
/sbin/start-stop-daemon --stop -q --exec $binary
|
||||
check_status
|
||||
;;
|
||||
restart)
|
||||
$0 stop && $0 start || return=$rc_failed
|
||||
|
||||
Reference in New Issue
Block a user