mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-06-03 10:50:20 +00:00
only do a update if DNS entry is outdated
This commit is contained in:
parent
7d44f0c4e4
commit
6acc4cc44f
@ -269,23 +269,26 @@ doGetWANIP()
|
||||
# this function is called via cronjob
|
||||
doUpdate()
|
||||
{
|
||||
dnsentry=$(nslookup ${host}|tail -n2|grep A|sed s/[^0-9.]//g)
|
||||
if [ "${dnsentry}" = "${wanip}" ];then
|
||||
return
|
||||
fi
|
||||
if [ ! -z ${server} ];then
|
||||
start-stop-daemon -S -x ${UPDATE_TOOL} -m -p ${PIDFILE} -- -c ${cfgfile}
|
||||
fi
|
||||
|
||||
if [ ! -z ${updateurl} ];then
|
||||
doReplaceVars
|
||||
if [ "${basicauth}" = "enabled" ];then
|
||||
local wgetoptions=" --user $user --password $pass "
|
||||
local wgetoptions=" --user ${user} --password ${pass} "
|
||||
fi
|
||||
if [ "${ignoreCertError}" = "enabled" ];then
|
||||
local wgetoptions=" --no-check-certificate "
|
||||
fi
|
||||
|
||||
$WGET ${wgetoptions} "${updateurl}"
|
||||
${WGET} ${wgetoptions} "${updateurl}"
|
||||
# ToDo: check the returning text from WEB Server. User need to give expected string.
|
||||
if [ $? -eq 0 ];then
|
||||
${0} success $wanip
|
||||
if [ ${?} -eq 0 ];then
|
||||
${0} success ${wanip}
|
||||
else
|
||||
${0} failed
|
||||
fi
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user