• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/netifd/examples/proto/pptp.sh

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

This page was automatically generated by LXR 0.3.1.  •  OpenWrt