Skip to content

Commit

Permalink
fix: add opts for ips del (#2079)
Browse files Browse the repository at this point in the history
  • Loading branch information
lut777 committed Nov 28, 2022
1 parent 4da9e4e commit d161638
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion dist/images/del-redundant-ips.sh
Expand Up @@ -38,6 +38,7 @@ do
fi
done

DIP=()
for ip in "${IPS[@]}"
do
IN=true
Expand All @@ -49,6 +50,32 @@ do
fi
done
if $IN; then
delIPSWithIP "$ip"
DIP+=("$ip")
fi
done

if [ ${#DIP[@]} == 0 ]; then
echo "no redundant IPS"
exit 0
else
echo "listing redundant IPS:"
for ip in "${DIP[@]}"
do
echo $ip "$(kubectl get ips | grep $ip | awk '{print $1}')"
done
fi

read -p "Do you want to proceed? (yes/no) " yn

case $yn in
yes )
for ip in "${DIP[@]}"
do
delIPSWithIP "$ip"
done
;;
no )
exit;;
* ) echo invalid response, exist;
exit 1;;
esac

0 comments on commit d161638

Please sign in to comment.