Skip to content

Commit 2c51586

Browse files
committed
stop: small fix while removing aliases not previously set
1 parent 27019c4 commit 2c51586

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

share/pot/stop.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ _js_stop()
6161
_ipaddr="$_i"
6262
fi
6363
if potnet ip4check -H "$_ipaddr" ; then
64-
ifconfig "${_nic}" inet "$_ipaddr" -alias
64+
if ifconfig "${_nic}" | grep -q "inet $_ipaddr " ; then
65+
ifconfig "${_nic}" inet "$_ipaddr" -alias
66+
fi
6567
else
66-
ifconfig "${_nic}" inet6 "$_ipaddr" -alias
68+
if ifconfig "${_nic}" | grep -q "inet6 $_ipaddr " ; then
69+
ifconfig "${_nic}" inet6 "$_ipaddr" -alias
70+
fi
6771
fi
6872
done
6973
fi

0 commit comments

Comments
 (0)