1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hotspot_ynh.git synced 2024-09-03 19:25:53 +02:00

The script miserably crash if the command fails ... better to test the command in the if directly, no need to use $?

This commit is contained in:
Alexandre Aubin 2019-03-12 18:17:04 +01:00 committed by GitHub
parent 74ad064c7f
commit b909ba3b9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -293,8 +293,7 @@ systemctl reload nginx
# Remove IPv6 address set if there is a VPN installed # Remove IPv6 address set if there is a VPN installed
if [[ $ip6_addr != none ]]; then if [[ $ip6_addr != none ]]; then
ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/" if ip -6 address show dev tun0 2> /dev/null | grep -q "${ip6_addr}/"; then
if [[ "$?" -eq 0 ]]; then
ip address delete "${ip6_addr}/128" dev tun0 &> /dev/null ip address delete "${ip6_addr}/128" dev tun0 &> /dev/null
fi fi
fi fi