Skip to content

Instantly share code, notes, and snippets.

@vaclavbohac
Created April 30, 2012 13:06
Show Gist options
  • Save vaclavbohac/2558150 to your computer and use it in GitHub Desktop.
Save vaclavbohac/2558150 to your computer and use it in GitHub Desktop.
Pull latest changes from nettefw repo with ease and beauty everytime you log in.
#!/bin/bash
REPO=$HOME/repo/nette
SUMMARY="Nette Framework"
MESSAGE="Internet connection not availaible."
sleep 5 # delay for wifi connection
if curl --silent --head http://www.google.com/ | egrep "20[0-9] Found|30[0-9] Found" > /dev/null
then
if git --git-dir=$REPO/.git pull origin master 2> /dev/null | grep "up-to-date" > /dev/null
then
MESSAGE="You are up to date! There are currently no new updates."
else
MESSAGE="Your local Nette Framework repository was updated."
fi
fi
notify-send -i $HOME/Pictures/nette.png "$SUMMARY" "$MESSAGE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment