complain if conf file not found (rather than leaving relay to crash

with an assert whose cause may not be obvious)
This commit is contained in:
Eric House 2011-11-28 18:14:39 -08:00
parent 1b864b5527
commit f20f9d6503

View file

@ -8,7 +8,6 @@ PIDFILE=${DIR}/xwrelay.pid
CONFFILE=${DIR}/xwrelay.conf
IDFILE=${DIR}/nextid.txt
CSSFILE=${DIR}/xwrelay.css
CONFFILE=${DIR}/xwrelay.conf
LOGFILE=/tmp/xwrelay_log_$$.txt
#LOGFILE=/dev/null
@ -79,6 +78,10 @@ do_start() {
elif pidof $XWRELAY >/dev/null; then
echo "already running: pid($XWRELAY)=>$(pidof $XWRELAY)" | tee -a $LOGFILE
else
if [ ! -e $CONFFILE ]; then
echo "unable to find $CONFFILE"
exit 1
fi
echo "starting..." | tee -a $LOGFILE
echo "running $XWRELAY $@ -f $CONFFILE -s $CSSFILE" | tee -a $LOGFILE
$XWRELAY $@ -f $CONFFILE -i $IDFILE -s $CSSFILE &