CURDIR=`dirname "$0"`
cd $CURDIR
CURDIR=`pwd`
LSWSHOME=`dirname $CURDIR`
LSWSHOME=`dirname $LSWSHOME`
LOGFILE=$LSWSHOME/autoupdate/update.log
CURTIME=`date "+[%Y-%m-%d %k:%M:%S]"`
test_license()
{
if [ -f "$LSWSHOME/conf/serial.no" ]; then
cp "$LSWSHOME/conf/serial.no" "./serial.no"
fi
if [ -f "$LSWSHOME/conf/trial.key" ] && [ ! -f "./trial.key" ]; then
cp "$LSWSHOME/conf/trial.key" "./trial.key"
fi
if [ -f "./serial.no" ]; then
bin/lshttpd -r
fi
if [ -f "./license.key" ] && [ -f "./serial.no" ]; then
output=`bin/lshttpd -t`
if [ $? -ne 0 ]; then
echo $output >> $LOGFILE
echo "$CURTIME [ERROR] License key verification failed" >> $LOGFILE
exit 1
fi
fi
}
if [ "x$3" = "x" ]; then
cat <