Commit 1fb879fc authored by Omar Kallel's avatar Omar Kallel
Browse files

icwmp: get dhcp 43 option in icwmp hotplug script instead of netifd package

parent a3fd03c3
......@@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp
PKG_VERSION:=8.2.2-2021-10-12
PKG_VERSION:=8.2.3-2021-10-13
PKG_FIXUP:=autoreconf
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
PKG_SOURCE_PROTO:=git
......
......@@ -2,6 +2,7 @@
. /lib/functions/network.sh
[ "$ACTION" == "ifup" ] || exit 0
[ -f /etc/config/cwmp ] || exit 0
......@@ -23,7 +24,7 @@ handle_icwmp_restart() {
local ifname="$(uci -q get network.$INTERFACE.ifname)"
[ "${ifname:0:1}" == "@" ] && exit 0
mkdir -p /tmp/ipv4
network_flush_cache
......@@ -63,6 +64,36 @@ handle_icwmp_restart() {
network_get_device curdev $INTERFACE
[ -n "$curdev" ] && echo $curdev > $devfile || rm -f $devfile
local wan_iface=`uci get cwmp.cpe.default_wan_interface`
local vendorspecinf=`ubus call network.interface.wan status | jsonfilter -e "@.data.vendorspecinf"`
[ -n "$vendorspecinf" ] && {
local url=""
case $vendorspecinf in
http://*|https://*)
url="$vendorspecinf"
;;
*)
for optval in $vendorspecinf; do
case $optval in
1=*)
url="$(echo $optval | cut -d"=" -f2-)"
;;
esac
done
;;
esac
if [ ! -f /var/state/cwmp ]; then
touch /var/state/cwmp
fi
uci -q -c /var/state/ get cwmp.acs
if [ "$?" -ne 0 ]; then
unnamed=`uci -q -c /var/state/ add cwmp acs`
uci -c /var/state/ -q rename cwmp.$unnamed='acs'
fi
[ -n "$url" ] && uci -c /var/state -q set cwmp.acs.dhcp_url="$url"
uci -c /var/state commit cwmp
}
local prevopt43url=""
local curopt43url=""
local opt43urlfile=/tmp/ipv4/$INTERFACE-opt43url
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment