mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-28 09:58:30 +01:00
38 lines
643 B
Bash
38 lines
643 B
Bash
|
#!/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
|