6 ppp_generic_init_config
() {
7 proto_config_add_string
"username"
8 proto_config_add_string
"password"
9 proto_config_add_int
"keepalive"
12 proto_ppp_init_config
() {
15 ppp_generic_init_config
19 echo "ppp_setup($1): $2"
22 proto_ppp_teardown
() {
28 proto_pppoe_init_config
() {
29 ppp_generic_init_config
36 json_get_var username username
37 json_get_var password password
38 echo "pppoe_setup($interface, $device), username=$username, password=$password"
39 proto_init_update ppp0
1
40 proto_add_ipv4_address
"192.168.2.1" 32
41 proto_add_dns_server
"192.168.2.2"
42 proto_add_ipv4_route
"0.0.0.0" 0 192.168.2.2
44 json_add_string
"ppp-type" "pppoe"
46 proto_send_update
"$interface"
47 proto_run_command
"$interface" sleep 30
50 proto_pppoe_teardown
() {
52 proto_notify_error
"$interface" PROCESS_KILLED
53 proto_block_restart
"$interface"
55 proto_kill_command
"$interface"