Remove ipv6 host addresses from list

This commit is contained in:
bergware
2023-08-13 13:13:56 +02:00
parent cc4b6334fd
commit c90c7ade0e
2 changed files with 4 additions and 4 deletions

View File

@@ -147,10 +147,10 @@ min6() {
wipe() {
wet=($*)
# remove temporary (privacy extensions) ipv6 addresses
# remove temporary (privacy extensions) and host ipv6 addresses
for tmp in $(ip -br -6 addr show scope global temporary dev $wet 2>/dev/null|awk '{$1=$2="";print}'); do
for i in ${!wet[@]}; do
[[ ${wet[$i]} == $tmp ]] && unset 'wet[i]'
[[ ${wet[$i]} == $tmp || ${wet[$i]#*/} == 128 ]] && unset 'wet[i]'
done
done
# return cleaned-up list without interface name

View File

@@ -89,10 +89,10 @@ min6() {
wipe() {
wet=($*)
# remove temporary (privacy extensions) ipv6 addresses
# remove temporary (privacy extensions) and host ipv6 addresses
for tmp in $(ip -br -6 addr show scope global temporary dev $wet 2>/dev/null|awk '{$1=$2="";print}'); do
for i in ${!wet[@]}; do
[[ ${wet[$i]} == $tmp ]] && unset 'wet[i]'
[[ ${wet[$i]} == $tmp || ${wet[$i]#*/} == 128 ]] && unset 'wet[i]'
done
done
# return cleaned-up list without interface name