diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-05-05 14:43:13 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-05-05 14:43:13 +0200 |
commit | 0c583b94a530e2c34338a614689e0f9cec1e8664 (patch) | |
tree | 7328dedb0e9a8a52a6d0f4fc90b3c59dcd0b2836 /dummy | |
parent | 264a79bad6862c39f90c521f5321be9ba2ea5f24 (diff) |
add a dummy pptp proto handler script
Diffstat (limited to 'dummy')
-rwxr-xr-x | dummy/proto/pptp.sh | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dummy/proto/pptp.sh b/dummy/proto/pptp.sh new file mode 100755 index 0000000..914604f --- /dev/null +++ b/dummy/proto/pptp.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +. ../netifd-proto.sh +init_proto "$@" + +proto_pptp_init_config() { + no_device=1 + available=1 + + proto_config_add_string "username" + proto_config_add_string "password" + proto_config_add_string server +} + +proto_pptp_setup() { + local interface="$1" + local device="$2" + + json_get_var server server + proto_add_host_dependency "$interface" "$server" + + json_get_var username username + json_get_var password password + echo "pptp_setup($interface), username=$username, password=$password" + proto_init_update "pptp-$interface" 1 + proto_set_keep 1 + proto_add_ipv4_address "192.168.9.1" 32 + proto_add_dns_server "192.168.9.2" + proto_add_ipv4_route "0.0.0.0" 0 192.168.9.2 + proto_add_data + json_add_string "ppp-type" "pptp" + proto_close_data + proto_send_update "$interface" + + proto_run_command "$interface" sleep 30 +} + +proto_pptp_teardown() { + return +} + +add_protocol pptp + |