Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
VPN_CONFIG="/var/ipfire/vpn/config"
VPN_CONFIG="/var/ipfire/vpn/config"
+eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
eval $(/usr/local/bin/readhash /var/ipfire/vpn/settings)
VARS=(
eval $(/usr/local/bin/readhash /var/ipfire/vpn/settings)
VARS=(
local action
local interfaces=()
local action
local interfaces=()
+ local vpn_ip
+
+ # Handle %defaultroute
+ if [ "${VPN_IP}" = "%defaultroute" ]; then
+ if [ -r "/var/ipfire/red/local-ipaddress" ]; then
+ vpn_ip="$(</var/ipfire/red/local-ipaddress)"
+
+ elif [ "${RED_TYPE}" = "STATIC" -a -n "${RED_ADDRESS}" ]; then
+ vpn_ip="${RED_ADDRESS}"
+
+ fi
+ else
+ vpn_ip="${VPM_IP}"
+ fi
# We are done when IPsec is not enabled
if [ "${ENABLED}" = "on" ]; then
# We are done when IPsec is not enabled
if [ "${ENABLED}" = "on" ]; then
interfaces+=( "${intf}" )
local args=(
interfaces+=( "${intf}" )
local args=(
"remote" "${righthost}"
"ttl" "255"
)
"remote" "${righthost}"
"ttl" "255"
)