add support for killing running proto-shell tasks with an arbitrary signal and waitin...
[project/netifd.git] / dummy / proto / ppp.sh
index 8e8ceb2..837767b 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 
-. netifd-proto.sh
+. ../netifd-proto.sh
+init_proto "$@"
 
 ppp_init_config() {
        proto_config_add_string "username"
@@ -32,10 +33,21 @@ pppoe_init() {
 }
 
 pppoe_setup() {
-       echo "pppoe_setup($1, $3): $2"
+       local interface="$1"
+       local device="$2"
+
+       json_get_var username username
+       json_get_var password password
+       echo "pppoe_setup($interface, $device), username=$username, password=$password"
+       proto_init_update ppp0 1
+       proto_add_ipv4_address "192.168.2.1" 32
+       proto_add_dns_server "192.168.2.2"
+       proto_send_update "$interface"
+       proto_run_command "$interface" sleep 10
 }
 
 pppoe_teardown() {
+       proto_kill_command "$interface"
        return
 }