icwmp: 8.4.7

This commit is contained in:
vdutta 2022-05-09 14:39:07 +05:30
parent f6cdb4c55d
commit 744bd43658
3 changed files with 27 additions and 9 deletions

View file

@ -8,7 +8,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=icwmp PKG_NAME:=icwmp
PKG_VERSION:=8.4.6 PKG_VERSION:=8.4.7
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git

View file

@ -6,7 +6,9 @@ log() {
handle_icwmp_update() { handle_icwmp_update() {
local defwan vendorspecinf update local defwan vendorspecinf update
local fallback_restart
fallback_restart="${1:-0}"
update="0" update="0"
defwan="$(uci -q get cwmp.cpe.default_wan_interface)" defwan="$(uci -q get cwmp.cpe.default_wan_interface)"
vendorspecinf="$(ifstatus "${defwan}" | jsonfilter -e "@.data.vendorspecinf")" vendorspecinf="$(ifstatus "${defwan}" | jsonfilter -e "@.data.vendorspecinf")"
@ -76,18 +78,23 @@ handle_icwmp_update() {
fi fi
fi fi
} }
# In case of update restart icwmp
if [ "${update}" -eq "1" ]; then if [ "${update}" -eq "1" ]; then
log "CWMP uci changes, reload cwmp with uci commit" log "CWMP uci changes, reload cwmp with uci commit"
ubus call uci commit '{"config":"cwmp"}' ubus call uci commit '{"config":"cwmp"}'
else else
if ubus list tr069 >/dev/null 2>&1 ; then status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
log "Trigger out of bound inform" if [ "$status" = "failure" ]; then
ubus call tr069 inform log "Trigger out of bound inform, since last inform status was failure"
else ubus -t 10 call tr069 inform >/dev/null 2>&1
log "Restarting icwmp tr069 object not found" # Handle timeout
/etc/init.d/icwmpd restart if [ "$?" -eq 7 ]; then
log "Restarting icwmp tr069 object"
/etc/init.d/icwmpd restart
fi
fi fi
fi fi
} }
handle_icwmp_update handle_icwmp_update $@

View file

@ -102,6 +102,7 @@ validate_acs_section()
'periodic_inform_interval:uinteger' \ 'periodic_inform_interval:uinteger' \
'periodic_inform_time:string' \ 'periodic_inform_time:string' \
'url:string' \ 'url:string' \
'dhcp_discovery:string' \
'dhcp_url:string' \ 'dhcp_url:string' \
'compression:or("GZIP","Deflate","Disabled")' \ 'compression:or("GZIP","Deflate","Disabled")' \
'retry_min_wait_interval:range(1, 65535)' \ 'retry_min_wait_interval:range(1, 65535)' \
@ -168,10 +169,12 @@ start_service() {
local enable_cwmp local enable_cwmp
local wan_interface local wan_interface
local dhcp_discovery local dhcp_discovery
local dhcp_url
config_load cwmp config_load cwmp
config_get_bool enable_cwmp cpe enable 1 config_get_bool enable_cwmp cpe enable 1
config_get dhcp_discovery acs dhcp_discovery config_get dhcp_discovery acs dhcp_discovery "0"
config_get dhcp_url acs dhcp_url ''
config_get wan_interface cpe default_wan_interface "wan" config_get wan_interface cpe default_wan_interface "wan"
if [ "$enable_cwmp" = "0" ] || [ "$enable_cwmp" = "false" ]; then if [ "$enable_cwmp" = "0" ] || [ "$enable_cwmp" = "false" ]; then
@ -188,6 +191,13 @@ start_service() {
[ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq [ -f /usr/sbin/dnsmasq ] && log "Waiting for DNS Proxy to be started ..." && ubus -t 5 wait_for dnsmasq
[ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20 [ -f /etc/config/dhcp ] && log "Waiting for DNS Server(s) ..." && wait_for_resolvfile 20
if [ "${dhcp_discovery}" == "enable" ] || [ "${dhcp_discovery}" == "1" ]; then
if [ -z "${dhcp_url}" ]; then
log "Empty dhcp url, running update script"
/etc/icwmpd/update.sh
fi
fi
validate_defaults || { validate_defaults || {
log "Validation of defaults failed" log "Validation of defaults failed"
return 1; return 1;
@ -232,6 +242,7 @@ service_triggers() {
json_add_array json_add_array
json_add_string "" "run_script" json_add_string "" "run_script"
json_add_string "" "/etc/icwmpd/update.sh" json_add_string "" "/etc/icwmpd/update.sh"
json_add_string "" "1"
json_close_array json_close_array
json_close_array json_close_array
json_add_int "" "2000" json_add_int "" "2000"