My script is:
Code:
PID=$(pidof lighttpd)
if [ "$PID" == "" ] ; then
/etc/init.d/lighttpd start
fi
CONF="/etc/lighttpd/lighttpd.conf"
IP=$(ifconfig eth0 | grep "inet" | tr -s ' ' | sed 's/:/ /g' | cut -d ' ' -f 4)
while read line
do
if `echo $line | grep "server.port" 1>/dev/null 2>&1` ; then
SPORT=$(echo "$line" | cut -d'=' -f2)
SPORT=$(echo "$SPORT" | sed 's/ //g')
fi
done < $CONF
wget $IP:$SPORT/blog/rssfeed.php
if [ "$PID" == "" ] ; then
/etc/init.d/lighttpd stop
fi
echo "Blog: Updated at "`date "+%m/%d/%Y %H:%M:%S"`
/mnt/sda1/blogrss_chroot.sh: line 2: [: ==: unary operator expected
Can anyone explain the error?
thanks,