mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-14 08:01:38 +01:00
init.d style script for starting and stopping relay
This commit is contained in:
parent
4fb097369e
commit
be0005667f
1 changed files with 37 additions and 0 deletions
37
relay/xwrelay.sh
Executable file
37
relay/xwrelay.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/sh
|
||||
|
||||
XWRELAY="./xwrelay"
|
||||
PIDFILE=./xwrelay.pid
|
||||
|
||||
|
||||
case $1 in
|
||||
|
||||
stop)
|
||||
if [ -f $PIDFILE ]; then
|
||||
sync
|
||||
echo "killing pid=$(cat $PIDFILE)"
|
||||
kill $(cat $PIDFILE)
|
||||
rm $PIDFILE
|
||||
else
|
||||
echo "not running"
|
||||
fi
|
||||
;;
|
||||
|
||||
restart)
|
||||
$0 stop
|
||||
sleep 1
|
||||
$0 start
|
||||
;;
|
||||
|
||||
start|*)
|
||||
if [ -f $PIDFILE ]; then
|
||||
echo "already running: pid=$(cat $PIDFILE)"
|
||||
else
|
||||
echo "starting..."
|
||||
$XWRELAY
|
||||
sleep 1
|
||||
echo "running with pid=$(cat $PIDFILE)"
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
Loading…
Reference in a new issue