43 lines
622 B
Bash
43 lines
622 B
Bash
#!/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
|