914604f5481b898653e0d506c3b1773bfdf6b07f
[project/netifd.git] / dummy / proto / pptp.sh
1 #!/bin/sh
2
3 . ../netifd-proto.sh
4 init_proto "$@"
5
6 proto_pptp_init_config() {
7 no_device=1
8 available=1
9
10 proto_config_add_string "username"
11 proto_config_add_string "password"
12 proto_config_add_string server
13 }
14
15 proto_pptp_setup() {
16 local interface="$1"
17 local device="$2"
18
19 json_get_var server server
20 proto_add_host_dependency "$interface" "$server"
21
22 json_get_var username username
23 json_get_var password password
24 echo "pptp_setup($interface), username=$username, password=$password"
25 proto_init_update "pptp-$interface" 1
26 proto_set_keep 1
27 proto_add_ipv4_address "192.168.9.1" 32
28 proto_add_dns_server "192.168.9.2"
29 proto_add_ipv4_route "0.0.0.0" 0 192.168.9.2
30 proto_add_data
31 json_add_string "ppp-type" "pptp"
32 proto_close_data
33 proto_send_update "$interface"
34
35 proto_run_command "$interface" sleep 30
36 }
37
38 proto_pptp_teardown() {
39 return
40 }
41
42 add_protocol pptp
43