1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 19:11:51 +00:00
openmptcprouter-feeds/luci-app-glorytun/root/etc/hotplug.d/iface/30-glorytun
2018-01-19 14:22:01 +01:00

27 lines
654 B
Bash

#!/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 iface "$config" dev
[ "$iface" = "$DEVICE" ] && {
config_get localip "$config" localip
config_get remoteip "$config" remoteip
[ "$remoteip" != "" ] && [ "$localip" != "" ] && ip addr add $localip peer $remoteip dev $DEVICE
}
}
config_load glorytun
config_foreach set_default glorytun