mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-13 10:30:16 +00:00
added function to replace vars from update URL
This commit is contained in:
parent
bc7ed8dec9
commit
145028d518
@ -153,6 +153,16 @@ doReadCFG()
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
doReplaceVars()
|
||||||
|
{
|
||||||
|
local url=`echo ${updateurl} | sed "s/<Ip>/${wanip}/g"`
|
||||||
|
url=`echo ${url} | sed "s/<Domain>/${host}/g"`
|
||||||
|
url=`echo ${url} | sed "s/<User>/${user}/g"`
|
||||||
|
url=`echo ${url} | sed "s/<Pass>/${pass}/g"`
|
||||||
|
url=`echo ${url} | sed "s/'//g"`
|
||||||
|
updateurl=$url
|
||||||
|
}
|
||||||
|
|
||||||
doStatus()
|
doStatus()
|
||||||
{
|
{
|
||||||
PROC=$(pgrep ${TOOLNAME})
|
PROC=$(pgrep ${TOOLNAME})
|
||||||
@ -226,7 +236,16 @@ doUpdate()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -z ${updateurl} ];then
|
if [ ! -z ${updateurl} ];then
|
||||||
echo "todo"
|
doReplaceVars
|
||||||
|
|
||||||
|
if [ "${basicauth}" = "enabled" ];then
|
||||||
|
wgetoptions=" --user $user --password $pass "
|
||||||
|
fi
|
||||||
|
if [ "${ignoreCertError}" = "enabled" ];then
|
||||||
|
wgetoptions=" --no-check-certificate "
|
||||||
|
fi
|
||||||
|
|
||||||
|
$WGET ${wgetoptions} ${updateurl}
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,6 +260,7 @@ case ${cmd} in
|
|||||||
doWriteCFG
|
doWriteCFG
|
||||||
;;
|
;;
|
||||||
start)
|
start)
|
||||||
|
doGetWANIP
|
||||||
if [ "$(cat $HELPERCFG |grep ^NAT | awk '{print $2}')" = "no" ];then
|
if [ "$(cat $HELPERCFG |grep ^NAT | awk '{print $2}')" = "no" ];then
|
||||||
#if we are not behind a NAT device and we use gnudip, start the daemon tool
|
#if we are not behind a NAT device and we use gnudip, start the daemon tool
|
||||||
if [ -f ${CFG} -a ! -z $(cat ${cfgfile} 2> /dev/null |grep server |cut -d = -f 2 |grep -v ^\'\')];then
|
if [ -f ${CFG} -a ! -z $(cat ${cfgfile} 2> /dev/null |grep server |cut -d = -f 2 |grep -v ^\'\')];then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user