diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-27 11:01:32 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-27 11:01:32 +0200 |
commit | 3c1a5bf324c8f2476239c4e49687ca252d3bf4c8 (patch) | |
tree | 4bb2bb1e1631344898fed229b9ee0c3615343895 /dummy | |
parent | 4ff6bcbee05983037f6a629b114beace5d98bdbe (diff) |
fold the _init callback into _init_config
Diffstat (limited to 'dummy')
-rwxr-xr-x | dummy/netifd-proto.sh | 5 | ||||
-rwxr-xr-x | dummy/proto/ppp.sh | 19 |
2 files changed, 10 insertions, 14 deletions
diff --git a/dummy/netifd-proto.sh b/dummy/netifd-proto.sh index 11337c2..e7f0d9e 100755 --- a/dummy/netifd-proto.sh +++ b/dummy/netifd-proto.sh @@ -229,12 +229,11 @@ init_proto() { json_init json_add_string "name" "$1" - eval "$1_init" - json_add_boolean no-device "$no_device" - json_add_boolean available "$available" json_add_array "config" eval "$1_init_config" json_close_array + json_add_boolean no-device "$no_device" + json_add_boolean available "$available" json_dump } ;; diff --git a/dummy/proto/ppp.sh b/dummy/proto/ppp.sh index 6f5dfcc..fc918a5 100755 --- a/dummy/proto/ppp.sh +++ b/dummy/proto/ppp.sh @@ -3,12 +3,18 @@ . ../netifd-proto.sh init_proto "$@" -ppp_init_config() { +ppp_generic_init_config() { proto_config_add_string "username" proto_config_add_string "password" proto_config_add_int "keepalive" } +ppp_init_config() { + no_device=1 + available=1 + ppp_generic_init_config +} + ppp_setup() { echo "ppp_setup($1): $2" } @@ -17,19 +23,10 @@ ppp_teardown() { return } -ppp_init() { - no_device=1 - available=1 -} - add_protocol ppp pppoe_init_config() { - ppp_init_config -} - -pppoe_init() { - return + ppp_generic_init_config } pppoe_setup() { |