Skip to content

Instantly share code, notes, and snippets.

@Stono
Created October 28, 2020 13:04
Show Gist options
  • Save Stono/e33f4696441a86b7759d1bb2f2f7b245 to your computer and use it in GitHub Desktop.
Save Stono/e33f4696441a86b7759d1bb2f2f7b245 to your computer and use it in GitHub Desktop.
#!/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