Last active
August 29, 2015 13:56
-
-
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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