mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
improved robustness of update script in case of connection trouble (wget may hang a long time if DNS fails or route is unavailable)
This commit is contained in:
parent
cb52d7fcf0
commit
6b6e7f695f
@ -6,6 +6,8 @@
|
||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
#static values
|
||||
WGET=$(which wget)
|
||||
WGETOPTIONS="-4 -o /dev/null -t 3 -T 3"
|
||||
EMPTYSTRING="none"
|
||||
NOIP="0.0.0.0"
|
||||
#how often do we poll for IP changes if we are behind a NAT?
|
||||
@ -130,7 +132,7 @@ doGetWANIP()
|
||||
{
|
||||
if [ ! -z $IPURL ];then
|
||||
OUTFILE=`mktemp`
|
||||
wget -4 -o /dev/null -O $OUTFILE $IPURL
|
||||
$WGET $WGETOPTIONS -O $OUTFILE $IPURL
|
||||
WANIP=`cat $OUTFILE`
|
||||
rm $OUTFILE
|
||||
else
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user