mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2026-03-02 23:44:37 +01:00
ask for dhcp options 66 67 128 only if iup is enabled
This commit is contained in:
parent
a17530309f
commit
8a2939ddde
1 changed files with 32 additions and 0 deletions
|
|
@ -29,6 +29,38 @@ init_iup() {
|
|||
config_load provisioning
|
||||
config_get interval polling interval
|
||||
config_get starttime polling starttime
|
||||
|
||||
### Ask for IUP related DHCP options only if IUP is enabled ###
|
||||
local enabled
|
||||
local newreqopts=
|
||||
local baseopts=
|
||||
local reqopts="$(uci -q get network.wan.reqopts)"
|
||||
local proto="$(uci -q get network.wan.proto)"
|
||||
local iupopts="66 67 128"
|
||||
local ropt iopt
|
||||
config_get enabled iup enabled "off"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128) ;;
|
||||
*) baseopts="$baseopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
ropt=""
|
||||
reqopts="$baseopts $iupopts"
|
||||
for ropt in $reqopts; do
|
||||
case $ropt in
|
||||
66|67|128) [ $enabled == "on" ] && newreqopts="$newreqopts $ropt" ;;
|
||||
*) newreqopts="$newreqopts $ropt" ;;
|
||||
esac
|
||||
done
|
||||
if [ $proto == "dhcp" ]; then
|
||||
newreqopts="$(echo $newreqopts | sed "s/^[ \t]*//")"
|
||||
uci -q set network.wan.reqopts="$newreqopts"
|
||||
uci commit network
|
||||
ubus call network reload
|
||||
fi
|
||||
#################################################################
|
||||
|
||||
if [ $interval == "weekly" ]; then
|
||||
interval="0"
|
||||
elif [ $interval == "hourly" ]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue