summaryrefslogtreecommitdiffhomepage
path: root/dummy/proto/ppp.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-09-24 09:35:22 +0200
committerFelix Fietkau <nbd@openwrt.org>2013-10-19 17:31:55 +0200
commitc8e879595400e3485b5a075797290a1061c0b04f (patch)
treec690284dd1ae22cb52b9be1f355881685e4c5f7d /dummy/proto/ppp.sh
parent89c6331673054d530b30b8e9e8bdf331639dfcd5 (diff)
scripts: reorganize directory layout
move example scripts from dummy/ to examples/ keep scripts that can be used as-is in scripts/ Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'dummy/proto/ppp.sh')
-rwxr-xr-xdummy/proto/ppp.sh70
1 files changed, 0 insertions, 70 deletions
diff --git a/dummy/proto/ppp.sh b/dummy/proto/ppp.sh
deleted file mode 100755
index c710bf2..0000000
--- a/dummy/proto/ppp.sh
+++ /dev/null
@@ -1,70 +0,0 @@
-#!/bin/sh
-
-. ../netifd-proto.sh
-init_proto "$@"
-
-ppp_generic_init_config() {
- proto_config_add_string "username"
- proto_config_add_string "password"
- proto_config_add_int "keepalive"
-}
-
-proto_ppp_init_config() {
- no_device=1
- available=1
- ppp_generic_init_config
-}
-
-proto_ppp_setup() {
- echo "ppp_setup($1): $2"
-}
-
-proto_ppp_teardown() {
- return
-}
-
-add_protocol ppp
-
-proto_pppoe_init_config() {
- ppp_generic_init_config
-}
-
-proto_pppoe_setup() {
- 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 pppoe-$interface 1
- proto_set_keep 1
- proto_add_ipv4_address "192.168.2.1" 32
- proto_add_dns_server "192.168.2.2"
- proto_add_ipv4_route "0.0.0.0" 0 192.168.2.2
- proto_add_data
- json_add_string "ppp-type" "pppoe"
- proto_close_data
- proto_send_update "$interface"
-
- proto_init_update pppoe-$interface 1
- proto_set_keep 1
- proto_add_ipv6_address "fe80::2" 64
- proto_add_ipv6_route "::0" 0 "fe80::1"
- proto_add_data
- json_add_string "ppp-type" "pppoe"
- proto_close_data
- proto_send_update "$interface"
-
- proto_run_command "$interface" sleep 30
-}
-
-proto_pppoe_teardown() {
- [ "$ERROR" = 9 ] && {
- proto_notify_error "$interface" PROCESS_KILLED
- proto_block_restart "$interface"
- }
- proto_kill_command "$interface"
- return
-}
-
-add_protocol pppoe