From 17ff670104c1e712c63981f73e781bcbc563e699 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 7 Feb 2024 23:57:52 +0100 Subject: [PATCH] use -n --- scripts/inner_basic.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/inner_basic.sh b/scripts/inner_basic.sh index e750e9b..a43d10c 100644 --- a/scripts/inner_basic.sh +++ b/scripts/inner_basic.sh @@ -10,22 +10,23 @@ echo "VPN_IPV4_ADDRESS=${VPN_IPV4_ADDRESS}" echo "VPN_IPV6_ADDRESS=${VPN_IPV6_ADDRESS}" echo "-- inner_basic.sh --" -if [ -z "${VPN_IPV4_ADDRESS}" ] + +if [ -n "${VPN_IPV4_ADDRESS}" ] then ip addr add ${VPN_IPV4_ADDRESS} dev vpn fi -if [ -z "${VPN_IPV6_ADDRESS}" ] +if [ -n "${VPN_IPV6_ADDRESS}" ] then ip addr add ${VPN_IPV6_ADDRESS} dev vpn fi -if [ -z "${VPN_IPV4_ADDRESS}" ] +if [ -n "${VPN_IPV4_ADDRESS}" ] then ip -4 route add default dev vpn fi -if [ -z "${VPN_IPV6_ADDRESS}" ] +if [ -n "${VPN_IPV6_ADDRESS}" ] then ip -6 route add default dev vpn fi