mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
New interface for Glorytun TCP VPN
This commit is contained in:
parent
4a825c5650
commit
9ceaa526a5
23 changed files with 125 additions and 1071 deletions
28
luci-app-glorytun-tcp/root/etc/hotplug.d/iface/30-glorytun
Normal file
28
luci-app-glorytun-tcp/root/etc/hotplug.d/iface/30-glorytun
Normal file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Load the glorytun config
|
||||
#
|
||||
# Author: Ycarus (Yannick Chabanois) <ycarus@zugaina.org>
|
||||
# Released under GPL 3 or later
|
||||
|
||||
[ "$ACTION" = ifup -o "$ACTION" = ifupdate ] || exit 0
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/network.sh
|
||||
|
||||
set_default() {
|
||||
local localip
|
||||
local remoteip
|
||||
local config="$1"
|
||||
local iface
|
||||
config_get enable "$config" enable
|
||||
config_get iface "$config" dev
|
||||
[ "$iface" = "$DEVICE" ] && [ "$enable" = "1" ] && {
|
||||
config_get localip "$config" localip
|
||||
config_get remoteip "$config" remoteip
|
||||
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ifconfig $DEVICE $localip pointopoint $remoteip up
|
||||
}
|
||||
}
|
||||
|
||||
config_load glorytun
|
||||
config_foreach set_default glorytun
|
Loading…
Add table
Add a link
Reference in a new issue