Add syslog support, actual pin signals and mock support
This commit is contained in:
parent
ae24bac0bc
commit
f2b96ece0d
3 changed files with 98 additions and 52 deletions
42
init
Normal file
42
init
Normal file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
### BEGIN INIT INFO
|
||||
# Provides: kerstezel
|
||||
# Required-Start: $network
|
||||
# Required-Stop:
|
||||
# Default-Start: S
|
||||
# Default-Stop:
|
||||
# Short-Description: Set hostname based on /etc/hostname
|
||||
### END INIT INFO
|
||||
. /etc/init.d/functions
|
||||
|
||||
address=santaofiapc.rocks
|
||||
port=9305
|
||||
|
||||
dapid=0
|
||||
|
||||
case $1 in
|
||||
start)
|
||||
( while true; do /sbin/kerstezel $address $port; sleep 10; done; ) &
|
||||
dapid=$!
|
||||
;;
|
||||
stop)
|
||||
if [ $dapid -ne 0 ]; then
|
||||
kill $dapid
|
||||
dapid=0
|
||||
else
|
||||
echo "Not running"
|
||||
exit 1
|
||||
done
|
||||
;;
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
*)
|
||||
echo "usage: $0 start|stop|restart"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue