refactor for future ipv6 support

This commit is contained in:
nom3ad
2024-01-02 23:13:06 +05:30
committed by Brian May
parent dadfba488b
commit 1885974f52
5 changed files with 82 additions and 32 deletions

View File

@@ -17,7 +17,7 @@ function with_set_x() {
iface="$(ip route | awk '/default/ { print $5 }')"
default_gw="$(ip route | awk '/default/ { print $3 }')"
for addr in ${IP_ADDRESSES//,/ }; do
for addr in ${ADD_IP_ADDRESSES//,/ }; do
echo ">>> Adding $addr to interface $iface"
net_addr=$(ipcalc -n "$addr" | awk -F= '{print $2}')
with_set_x ip addr add "$addr" dev "$iface"