Skip to content

Instantly share code, notes, and snippets.

@codatory
Created August 30, 2012 02:43
Show Gist options
  • Save codatory/3521849 to your computer and use it in GitHub Desktop.
Save codatory/3521849 to your computer and use it in GitHub Desktop.
#!/bin/sh
FILENAME='check_update.sh'
URL='https://raw.github.com/gist/1950778'
if [[ -f $FILENAME ]]; then
echo 'Updating file in place...'
curl --retry 3 --progress-bar --location --time-cond $FILENAME --remote-time --output $FILENAME $URL
else
echo 'File does not exist, downloading...'
curl --retry 3 --progress-bar --remote-time --location --output $FILENAME $URL
chmod +x $FILENAME
fi
./$FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment