diff --git a/icwmp/Makefile b/icwmp/Makefile index a5bf4984f..711537040 100755 --- a/icwmp/Makefile +++ b/icwmp/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=icwmp -PKG_VERSION:=8.1.4-2021-09-01 +PKG_VERSION:=8.1.5-2021-09-02 PKG_FIXUP:=autoreconf PKG_SOURCE_URL:=https://dev.iopsys.eu/iopsys/icwmp.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_VERSION:=25df1147fc759d408ab04814dcc8bf3113a12894 +PKG_SOURCE_VERSION:=696327f0c1a31cc6731c1871a7a8ac0d39bc964d PKG_RELEASE=$(PKG_SOURCE_VERSION) PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz PKG_MIRROR_HASH:=skip diff --git a/icwmp/files/etc/init.d/icwmpd b/icwmp/files/etc/init.d/icwmpd index 6f6bb15b4..ce3cd6519 100755 --- a/icwmp/files/etc/init.d/icwmpd +++ b/icwmp/files/etc/init.d/icwmpd @@ -154,35 +154,74 @@ set_wan_interface() { fi } +validate_acs_section() +{ + uci_validate_section cwmp acs "acs" \ + 'passwd:string' \ + 'periodic_inform_enable:bool' \ + 'periodic_inform_interval:uinteger' \ + 'periodic_inform_time:string' \ + 'url:string:http://192.168.1.1' \ + 'dhcp_discovery:or("enable", "disable")' \ + 'compression:or("GZIP","Deflate","Disabled")' \ + 'retry_min_wait_interval:range(1, 65535)' \ + 'retry_interval_multiplier:range(1000, 65535)' \ + 'https_ssl_capath:file' \ + 'ipv6_enable:bool' + +} + +validate_cpe_section() +{ + uci_validate_section cwmp cpe "cpe" \ + 'interface:string' \ + 'default_wan_interface:string' \ + 'log_to_console:or("enable","disable")' \ + 'log_to_file:or("enable","disable")' \ + 'log_severity:or("EMERG", "ALERT", "CRITIC" ,"ERROR", "WARNING", "NOTICE", "INFO", "DEBUG")' \ + 'log_file_name:string' \ + 'log_max_size:uinteger' \ + 'userid:string' \ + 'passwd:string' \ + 'port:uinteger' \ + 'provisioning_code:string:""' \ + 'amd_version:range(1, 6)' \ + 'instance_mode:or("InstanceNumber","InstanceAlias")' \ + 'session_timeout:uinteger' \ + 'notification:bool' \ + 'exec_download:bool' \ + 'periodic_notify_enable:bool' \ + 'periodic_notify_interval:uinteger' +} + start_service() { - if [ ! -f /tmp/.icwmpd_boot ]; then - touch /etc/icwmpd/.icwmpd_boot - touch /tmp/.icwmpd_boot - else - [ -f /sbin/netifd ] && log "Waiting for Network to be started ..." && ubus -t 5 wait_for network.interface - [ -f /etc/config/wireless ] && log "Waiting for WiFi to be started ..." && ubus -t 5 wait_for network.wireless - [ -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 /usr/sbin/asterisk ] && log "Waiting for Voice to be started ..." && ubus -t 5 wait_for asterisk + config_load cwmp + set_wan_interface + wait_for_option43 20 + get_acs_url - config_load cwmp - set_wan_interface - wait_for_option43 20 - get_acs_url - - procd_open_instance icwmp - procd_set_param command "$PROG" - if [ "$1" = "GetRPCMethods" ];then - procd_append_param command -g - elif [ -f /etc/icwmpd/.icwmpd_boot ]; then - procd_append_param command -b - fi - procd_set_param respawn \ - ${respawn_threshold:-5} \ - ${respawn_timeout:-10} ${respawn_retry:-3} - - procd_close_instance + validate_acs_section || { + log "Validation of acs section failed" + return 1; + } + + validate_cpe_section || { + log "Validation of cpe section failed" + return 1; + } + + procd_open_instance icwmp + procd_set_param command "$PROG" + if [ "$1" = "GetRPCMethods" ]; then + procd_append_param command -g fi + procd_append_param command -b + + procd_set_param respawn \ + ${respawn_threshold:-5} \ + ${respawn_timeout:-10} ${respawn_retry:-3} + + procd_close_instance } reload_service() { diff --git a/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp b/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp deleted file mode 100755 index 1bf3f4511..000000000 --- a/icwmp/files/lib/upgrade/post-rootfs-fixup.d/215-icwmp +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# As part of sysupgrade we copy CWMP Backup Session XML file. - - -# Abort on any error. -set -e - - -# Do nothing if user want to discard old settings. -if [ -n "$SAVE_CONFIG" ] && [ $SAVE_CONFIG -eq 0 ]; then - exit 0 -fi - -# Source functions. -for f in /lib/upgrade/iopsys*.sh; do - [ -r "$f" -a -s "$f" ] || continue - source $f -done - - -if [ -s "${2}/etc/icwmpd/.icwmpd_backup_session.xml" ]; then - cat "${2}/etc/icwmpd/.icwmpd_backup_session.xml" > "/etc/icwmpd/.icwmpd_backup_session.xml" -fi - -# Report success. -log "post-hooks" "CWMP Backup Session XML file migrated" - -exit 0