From 26f8225d0a0b6db9ba4811726d6929115b0a9803 Mon Sep 17 00:00:00 2001 From: Alin Nastac Date: Thu, 19 Apr 2018 08:30:07 +0200 Subject: [PATCH] rp-pppoe: support for enabled uci parameters Signed-off-by: Alin Nastac --- net/rp-pppoe/files/pppoe-relay.init | 8 ++++++-- net/rp-pppoe/files/pppoe-server.init | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/net/rp-pppoe/files/pppoe-relay.init b/net/rp-pppoe/files/pppoe-relay.init index 26dd2c4b55..4cc034e38b 100755 --- a/net/rp-pppoe/files/pppoe-relay.init +++ b/net/rp-pppoe/files/pppoe-relay.init @@ -7,7 +7,9 @@ USE_PROCD=1 pppoe_triggers() { local cfg="$1" - local interface server_interfaces client_interfaces both_interfaces + local enabled interface server_interfaces client_interfaces both_interfaces + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return 0 config_get server_interfaces "$cfg" server_interface config_get client_interfaces "$cfg" client_interface config_get both_interfaces "$cfg" both_interfaces @@ -24,7 +26,9 @@ pppoe_triggers() { pppoe_relay_instance() { local cfg="$1" - local interface server_interfaces client_interfaces both_interfaces maxsessions timeout OPTIONS + local enabled interface server_interfaces client_interfaces both_interfaces maxsessions timeout OPTIONS + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return 0 config_get server_interfaces "$cfg" server_interface config_get client_interfaces "$cfg" client_interface config_get both_interfaces "$cfg" both_interfaces diff --git a/net/rp-pppoe/files/pppoe-server.init b/net/rp-pppoe/files/pppoe-server.init index b1182c0039..f0555ebd30 100755 --- a/net/rp-pppoe/files/pppoe-server.init +++ b/net/rp-pppoe/files/pppoe-server.init @@ -7,13 +7,17 @@ USE_PROCD=1 pppoe_triggers() { local cfg="$1" - local interface + local enabled interface + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return 0 config_get interface "$cfg" interface } pppoe_instance() { local cfg="$1" - local interface ac_name service_names service_name maxsessionsperpeer localip firstremoteip maxsessions optionsfiles randomsession unit offset timeout mss sync OPTIONS + local enabled interface ac_name service_names service_name maxsessionsperpeer localip firstremoteip maxsessions optionsfiles randomsession unit offset timeout mss sync OPTIONS + config_get_bool enabled "$cfg" enabled 1 + [ "$enabled" -gt 0 ] || return 0 config_get interface "$cfg" interface config_get ac_name "$cfg" ac_name config_get service_names "$cfg" service_name @@ -28,7 +32,7 @@ pppoe_instance() { config_get timeout "$cfg" timeout config_get mss "$cfg" mss config_get_bool sync "$cfg" sync 0 - config_get use_non_uci_config "$cfg" use_non_uci_config 0 + config_get_bool use_non_uci_config "$cfg" use_non_uci_config 0 if [ "$use_non_uci_config" -gt 0 ]; then . /etc/default/pppoe-server -- 2.30.2