Created
December 27, 2016 04:04
-
-
Save mariodian/c43055509853bffb492b7b228a143764 to your computer and use it in GitHub Desktop.
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/sh | |
# Create log file | |
LOG="/tmp/ip-check.log" | |
touch $LOG | |
IP="$(dig +short myip.opendns.com @resolver1.opendns.com)" | |
LAST_IP="$(cat $LOG)" | |
if [ "$IP" != "$LAST_IP" ]; then | |
# Save the new IP | |
echo $IP > $LOG | |
# Restart OB | |
sudo service openbazaar restart | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment