From b909ba3b9b99ef5ba5ec8b9a5cba45da7726a917 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 12 Mar 2019 18:17:04 +0100 Subject: [PATCH] The script miserably crash if the command fails ... better to test the command in the if directly, no need to use $? --- scripts/install | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/install b/scripts/install index c2493d4..059e1e3 100644 --- a/scripts/install +++ b/scripts/install @@ -293,8 +293,7 @@ systemctl reload nginx # Remove IPv6 address set if there is a VPN installed if [[ $ip6_addr != none ]]; then - ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/" - if [[ "$?" -eq 0 ]]; then + if ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"; then ip address delete "${ip6_addr}/128" dev tun0 &> /dev/null fi fi