Skip to content

Instantly share code, notes, and snippets.

@BlackEllis
Created February 6, 2018 04:47
Show Gist options
  • Save BlackEllis/3b284e689f64e3023561a5c424852426 to your computer and use it in GitHub Desktop.
Save BlackEllis/3b284e689f64e3023561a5c424852426 to your computer and use it in GitHub Desktop.
#!/bin/bash
RETRY_COUNT=5 # リトライ回数
COUNT=0 # カウントアップ用変数
cmd="$@" # 実行コマンド(引数)
echo -e "run command: $cmd\n"
until $cmd || [ $COUNT -eq $RETRY_COUNT ]; do
sleep $(( COUNT++ ))
echo "retory $COUNT"
done
echo -e "end command: $cmd\n\n"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment