mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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
|
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
||||||
|
|
||||||
#static values
|
#static values
|
||||||
|
WGET=$(which wget)
|
||||||
|
WGETOPTIONS="-4 -o /dev/null -t 3 -T 3"
|
||||||
EMPTYSTRING="none"
|
EMPTYSTRING="none"
|
||||||
NOIP="0.0.0.0"
|
NOIP="0.0.0.0"
|
||||||
#how often do we poll for IP changes if we are behind a NAT?
|
#how often do we poll for IP changes if we are behind a NAT?
|
||||||
@ -130,7 +132,7 @@ doGetWANIP()
|
|||||||
{
|
{
|
||||||
if [ ! -z $IPURL ];then
|
if [ ! -z $IPURL ];then
|
||||||
OUTFILE=`mktemp`
|
OUTFILE=`mktemp`
|
||||||
wget -4 -o /dev/null -O $OUTFILE $IPURL
|
$WGET $WGETOPTIONS -O $OUTFILE $IPURL
|
||||||
WANIP=`cat $OUTFILE`
|
WANIP=`cat $OUTFILE`
|
||||||
rm $OUTFILE
|
rm $OUTFILE
|
||||||
else
|
else
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user