X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fnetifd.git;a=blobdiff_plain;f=dummy%2Fproto%2Fppp.sh;h=bc7fd3c0403c78888a93323ce955cdf1f1788690;hp=f78933cc42dd33f74d5e2d3c0374ef00cb7f8dfa;hb=301cf1c6f2c2b155c476e1fb861eeaa19c533222;hpb=8b3e051a993acd3dcbc76818cc2726716a72cff7 diff --git a/dummy/proto/ppp.sh b/dummy/proto/ppp.sh index f78933c..bc7fd3c 100755 --- a/dummy/proto/ppp.sh +++ b/dummy/proto/ppp.sh @@ -3,36 +3,33 @@ . ../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_setup() { - echo "ppp_setup($1): $2" +proto_ppp_init_config() { + no_device=1 + available=1 + ppp_generic_init_config } -ppp_teardown() { - return +proto_ppp_setup() { + echo "ppp_setup($1): $2" } -ppp_init() { - no_device=1 - available=1 +proto_ppp_teardown() { + return } add_protocol ppp -pppoe_init_config() { - ppp_init_config -} - -pppoe_init() { - return +proto_pppoe_init_config() { + ppp_generic_init_config } -pppoe_setup() { +proto_pppoe_setup() { local interface="$1" local device="$2" @@ -46,7 +43,11 @@ pppoe_setup() { proto_run_command "$interface" sleep 30 } -pppoe_teardown() { +proto_pppoe_teardown() { + [ "$ERROR" = 9 ] && { + proto_notify_error "$interface" PROCESS_KILLED + proto_block_restart "$interface" + } proto_kill_command "$interface" return }