Skip to content

Instantly share code, notes, and snippets.

@kernelkaribou
Last active September 2, 2017 18:39
Show Gist options
  • Save kernelkaribou/55c71ee3b7eebc6fd07827419d492001 to your computer and use it in GitHub Desktop.
Save kernelkaribou/55c71ee3b7eebc6fd07827419d492001 to your computer and use it in GitHub Desktop.
QuickScriptRepeater
#!/bin/bash
SCRIPT_CMD="/bin/bash ./my_script.sh"
TOTAL_RUNS=2
SLEEP_TIME=30
let SLEEP_COUNTER=TOTAL_RUNS-1
COUNTER=0
while [ $COUNTER -lt $TOTAL_RUNS ]; do
eval $SCRIPT_CMD
if [ $COUNTER -lt $SLEEP_COUNTER ]; then
sleep $SLEEP_TIME
fi
let COUNTER=COUNTER+1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment