Skip to content

Instantly share code, notes, and snippets.

@hhoover
Created March 7, 2013 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hhoover/5108950 to your computer and use it in GitHub Desktop.
Save hhoover/5108950 to your computer and use it in GitHub Desktop.
#!/bin/bash
STOP=$(($(date +%s)+300))
COMPLETE_FILE="/tmp/automation-complete"
ME="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/$( basename ${BASH_SOURCE[0]} )"
while [[ ! -f "${COMPLETE_FILE}" && $(date +%s) -lt ${STOP} ]];
do
sleep 1
done
rm -f ${ME} ${COMPLETE_FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment