Skip to content

Instantly share code, notes, and snippets.

@Stono
Created October 28, 2020 13:04
Embed
What would you like to do?
#!/bin/bash
TOTAL=$(istioctl proxy-status | tail -n +2 | awk '{print $7}' | wc -l)
prog() {
local w=100 p=$1; shift
pct="$(( $p*$w/$TOTAL ))"
printf -v dots "%*s" "$pct" ""; dots=${dots// /.};
printf "\r\e[K|%-*s| %3d %%" "$w" "$dots" "$pct";
}
while :
do
CURRENT=$(istioctl proxy-status | awk '{print $7}' | grep "1.6.12" | wc -l)
prog "$CURRENT"
if [ "$CURRENT" = "$TOTAL" ]; then
echo ""
echo "Voilla"
exit 0
fi
sleep 10
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment