This file contains 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 | |
# Uncomment the lines below to print the commands instead of executing them | |
# DEBUG refers to exporting from external dom0 | |
# DEBUG2 refers to importing the vm to local dom0 | |
#DEBUG="echo" | |
#DEBUG2="echo" | |
# You HAVE to inform at lease vm and host or else, usage in your face | |
if [ "$#" -lt 2 ]; then |
This file contains 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 | |
URL='http://www.dhl.com/content/g0/en/express/tracking.shtml?brand=DHL&AWB=<INSERT_TRACKING_CODE_HERE>%0D%0A' | |
BULK="$(curl -s "$URL" | egrep -A1 -m1 '<td class=".*" style="width: 5% ;text-align:left">.+</td>' | egrep -o '>.+<' | sed 's/[><]//g')" | |
CODE="$(echo $BULK | cut -d " " -f1)" | |
CTLFILE=/root/ctlfile | |
if [ "$CODE" -ne "$(cat $CTLFILE)" ]; then | |
echo $CODE > $CTLFILE | |
mail -s "DHL Update" <INSERT_YOUR_EMAIL_HERE> < <(echo $BULK) |
NewerOlder