From 3d00a29b9f7d8ab05ab6ead4e1d80416356ba824 Mon Sep 17 00:00:00 2001 From: Stephen Beaver Date: Thu, 8 Oct 2015 14:37:21 -0400 Subject: Further updates to pfSense-upgrade-GUI.sh --- src/usr/local/sbin/pfSense-upgrade-GUI.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src/usr/local/sbin') diff --git a/src/usr/local/sbin/pfSense-upgrade-GUI.sh b/src/usr/local/sbin/pfSense-upgrade-GUI.sh index 25086dd..aea5976 100755 --- a/src/usr/local/sbin/pfSense-upgrade-GUI.sh +++ b/src/usr/local/sbin/pfSense-upgrade-GUI.sh @@ -111,22 +111,27 @@ elif [ $ACTION == "-r" ] ; then fi UPDATEINPROGRESS=2 -LOCKFILE=/tmp/pkg-upgate_GUI.lck +LOCKFILE=/tmp/pkg-upgate-GUI.lck LOGFILE="webgui-log.txt" FIFO=/tmp/upgr.fifo JSONFILE="/cf/conf/webgui-log.json" if [ -e $LOCKFILE ] ; then - eval $(stat -s $LOCKFILE) - NOW=`date +%s` - let AGE="$NOW-$st_ctime" >/dev/null - - if [ $AGE -lt 300 ] && ( ! $FORCE ) ; then - message "Update in progress!" - exit $UPDATEINPROGRESS + if ( $FORCE ) ; then + message "Removing lockfile $LOCKFILE" + rm -f $LOCKFILE else - message "Removing stale lockfile $INPROGRESS" - rm -f $INPROGRESS + eval $(stat -s $LOCKFILE) + NOW=`date +%s` + let AGE="$NOW-$st_ctime" >/dev/null + + if [ $AGE -lt 300 ] ; then + message "Update in progress!" + exit $UPDATEINPROGRESS + else + message "Removing stale lockfile $LOCKFILE" + rm -f $LOCKFILE + fi fi fi -- cgit v1.1