use full paths so pidof doesn't pick up instances of xwrelay launched elsewhere

This commit is contained in:
Eric House 2010-10-07 19:41:02 -07:00
parent 86d73392d5
commit f2ad6d92b4

View file

@ -1,6 +1,6 @@
#!/bin/sh
DIR=${DIR:-$(dirname $0)}
DIR=$(pwd)
XWRELAY=${DIR}/xwrelay
PIDFILE=${DIR}/xwrelay.pid
CONFFILE=${DIR}/xwrelay.conf
@ -61,7 +61,7 @@ do_start() {
if [ -f $PIDFILE ] && [ -f /proc/$(cat $PIDFILE)/exe ]; then
echo "already running: pid=$(cat $PIDFILE)" | tee -a $LOGFILE
elif pidof $XWRELAY >/dev/null; then
echo "already running: pid=$(pidof $XWRELAY)" | tee -a $LOGFILE
echo "already running: pid($XWRELAY)=>$(pidof $XWRELAY)" | tee -a $LOGFILE
else
echo "starting..." | tee -a $LOGFILE
echo "running $XWRELAY $@ -f $CONFFILE -s $CSSFILE" | tee -a $LOGFILE