diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2015-10-08 14:37:21 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2015-10-08 14:37:21 -0400 |
commit | 3d00a29b9f7d8ab05ab6ead4e1d80416356ba824 (patch) | |
tree | 5b732a3aacbd7886e167a7e2e6068b63de1a79a6 /src/usr | |
parent | 42cf0f48181c4b6d1edd870d3905c94c9f1f485b (diff) | |
download | pfsense-3d00a29b9f7d8ab05ab6ead4e1d80416356ba824.zip pfsense-3d00a29b9f7d8ab05ab6ead4e1d80416356ba824.tar.gz |
Further updates to pfSense-upgrade-GUI.sh
Diffstat (limited to 'src/usr')
-rwxr-xr-x | src/usr/local/sbin/pfSense-upgrade-GUI.sh | 25 |
1 files changed, 15 insertions, 10 deletions
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 |