mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-02-04 08:13:38 +00:00
fixed reading uptime from system
This commit is contained in:
parent
7cb98f2122
commit
69c043fefb
@ -172,17 +172,18 @@ case $cmd in
|
||||
if [ "$OLDIP" != "$WANIP" -a "${WANIP}" != ${NOIP} ];then
|
||||
${UPDATE_TOOL} -c $FILE
|
||||
RESULT=$?
|
||||
cat /proc/uptime |awk '{print $1}' > $LASTUPDATE
|
||||
cat /proc/uptime |awk '{print $1}' |cut -d . -f 1 > $LASTUPDATE
|
||||
fi
|
||||
#if we don't know our WAN IP do a blind update once a hour
|
||||
if [ "${WANIP}" = ${NOIP} ];then
|
||||
UPTIME=`cat /proc/uptime`
|
||||
LAST=`cat $LASTUPDATE`
|
||||
UPTIME=`cat /proc/uptime |cut -d . -f 1`
|
||||
LAST=0
|
||||
[ -f $LASTUPDATE ] && LAST=`cat $LASTUPDATE`
|
||||
DIFF=`expr $UPTIME - $LAST`
|
||||
if [ $DIFF -gt $UPDATEMINUTESUNKNOWN ];then
|
||||
${UPDATE_TOOL} -c $FILE
|
||||
RESULT=$?
|
||||
cat /proc/uptime |awk '{print $1}' > $LASTUPDATE
|
||||
cat /proc/uptime |awk '{print $1}' |cut -d . -f 1> $LASTUPDATE
|
||||
fi
|
||||
fi
|
||||
if [ $RESULT -eq 0 ];then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user