Skip to content

Instantly share code, notes, and snippets.

@nasamuffin
Last active August 29, 2015 13:56
Show Gist options
  • Save nasamuffin/9194533 to your computer and use it in GitHub Desktop.
Save nasamuffin/9194533 to your computer and use it in GitHub Desktop.
Track a UPS package (so you don't have to do it yourself).
#!/bin/bash
RETVAL=1
while [ "$RETVAL" -eq "1" ]; do
sleep 1m
PAGECONTENT=$(wget "http://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=$1" --quiet -O -)
RETVAL=$?
if [ "$RETVAL" -eq "0" ]; then
echo "$PAGECONTENT" | grep -q Delivered
RETVAL=$?
fi
done
if [ "$RETVAL" -eq "0" ]; then
echo -e "\a\a\a\a\a\a\a\a\a\a"
echo "Your package is delivered!"
else
echo "There was another error."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment