mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
icwmp: 8.4.7
This commit is contained in:
parent
f6cdb4c55d
commit
744bd43658
3 changed files with 27 additions and 9 deletions
|
|
@ -8,7 +8,7 @@
|
|||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=icwmp
|
||||
PKG_VERSION:=8.4.6
|
||||
PKG_VERSION:=8.4.7
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ log() {
|
|||
|
||||
handle_icwmp_update() {
|
||||
local defwan vendorspecinf update
|
||||
local fallback_restart
|
||||
|
||||
fallback_restart="${1:-0}"
|
||||
update="0"
|
||||
defwan="$(uci -q get cwmp.cpe.default_wan_interface)"
|
||||
vendorspecinf="$(ifstatus "${defwan}" | jsonfilter -e "@.data.vendorspecinf")"
|
||||
|
|
@ -76,18 +78,23 @@ handle_icwmp_update() {
|
|||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# In case of update restart icwmp
|
||||
if [ "${update}" -eq "1" ]; then
|
||||
log "CWMP uci changes, reload cwmp with uci commit"
|
||||
ubus call uci commit '{"config":"cwmp"}'
|
||||
else
|
||||
if ubus list tr069 >/dev/null 2>&1 ; then
|
||||
log "Trigger out of bound inform"
|
||||
ubus call tr069 inform
|
||||
else
|
||||
log "Restarting icwmp tr069 object not found"
|
||||
/etc/init.d/icwmpd restart
|
||||
status="$(ubus call tr069 status |jsonfilter -qe '@.last_session.status')"
|
||||
if [ "$status" = "failure" ]; then
|
||||
log "Trigger out of bound inform, since last inform status was failure"
|
||||
ubus -t 10 call tr069 inform >/dev/null 2>&1
|
||||
# Handle timeout
|
||||
if [ "$?" -eq 7 ]; then
|
||||
log "Restarting icwmp tr069 object"
|
||||
/etc/init.d/icwmpd restart
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
handle_icwmp_update
|
||||
handle_icwmp_update $@
|
||||
|
|
|
|||
|
|
@ -102,6 +102,7 @@ validate_acs_section()
|
|||
'periodic_inform_interval:uinteger' \
|
||||
'periodic_inform_time:string' \
|
||||
'url:string' \
|
||||
'dhcp_discovery:string' \
|
||||
'dhcp_url:string' \
|
||||
'compression:or("GZIP","Deflate","Disabled")' \
|
||||
'retry_min_wait_interval:range(1, 65535)' \
|
||||
|
|
@ -168,10 +169,12 @@ start_service() {
|
|||
local enable_cwmp
|
||||
local wan_interface
|
||||
local dhcp_discovery
|
||||
local dhcp_url
|
||||
|
||||
config_load cwmp
|
||||
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"
|
||||
|
||||
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 /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 || {
|
||||
log "Validation of defaults failed"
|
||||
return 1;
|
||||
|
|
@ -232,6 +242,7 @@ service_triggers() {
|
|||
json_add_array
|
||||
json_add_string "" "run_script"
|
||||
json_add_string "" "/etc/icwmpd/update.sh"
|
||||
json_add_string "" "1"
|
||||
json_close_array
|
||||
json_close_array
|
||||
json_add_int "" "2000"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue