From fd4934a1e68e5319349e43094bb09ba9b09448de Mon Sep 17 00:00:00 2001 From: Neo_Chen Date: Sat, 9 Jan 2021 13:48:06 +0800 Subject: [PATCH] vpn: wg-postup: make IPv6 PTP optional --- vpn/wg-postup.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/vpn/wg-postup.sh b/vpn/wg-postup.sh index 86af848..74dae9b 100755 --- a/vpn/wg-postup.sh +++ b/vpn/wg-postup.sh @@ -8,5 +8,8 @@ PEER_IPV6="$5" ip addr del "$LOCAL_IP" dev "$IF" ip addr add "$LOCAL_IP" peer "$PEER_IP" dev "$IF" -ip addr del "$LOCAL_IPV6" dev "$IF" -ip addr add "$LOCAL_IPV6" peer "$PEER_IPV6" dev "$IF" + +if [ "$#" -ge 5 ]; then + ip addr del "$LOCAL_IPV6" dev "$IF" + ip addr add "$LOCAL_IPV6" peer "$PEER_IPV6" dev "$IF" +fi