Skip to content

Instantly share code, notes, and snippets.

@MarkRoddy
Forked from neilkod/gist:2117936
Created March 19, 2012 16:26
Show Gist options
  • Save MarkRoddy/2118072 to your computer and use it in GitHub Desktop.
Save MarkRoddy/2118072 to your computer and use it in GitHub Desktop.
# set -e
# if set -e was actually set, the first time the -f command
# returns non-zero, the entire program would exit with the return code
# from the ssh command. DO NOT WANT
while true
do
retval=`ssh user@some.server.com "ls -1 $src_dir/nz_${DOMAIN}_done.flag 2>/dev/null|wc -l"`
if [[ $retval -eq 0 ]]
then
sleep $SLEEP_DURATION
echo "`date` waiting....on nz_${DOMAIN}_done.flag"
else
break
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment