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 | |
# Reload iptables if... (e.g. ip was changed) | |
# Dependencies: dig (apt-get install dnsutils in debian/ubuntu) | |
# Note: Run "touch ~/current_ip" and add a new cron job with cmd "crontab -e" to run this script periodically. | |
HOSTNAME=<hostname-to-check.dyndns.org> | |
LOGFILE=~/current_ip | |
Current_IP=$(dig +short $HOSTNAME) |