Go to the App Store and install Xcode
Next, go to https://www.macports.org to download and install MacPorts
After this do
For gnome terminal:
sudo port install gnome-terminal
otherwise
sudo port install konsole
For both apps, you will also need
sudo port install xorg-server
In the Applications file under MacPorts, there should be an X11 app. Launch this before trying to launch either gnome-terminal or console.
#!/bin/bash
LOG='/path/to/log/dns.log'
echo "-----------------------" >> $LOG
echo "Running dns.sh" >> $LOG
echo $(date) >> $LOG
# get the current ip...
CURRENT_IP=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//')
echo "Current IP:"$CURRENT_IP >> $LOG
#FreeDNS updater script
UPDATE_URL="https://freedns.afraid.org/dynamic/update.php?<YOUR_API_KEY>"
SUBDOMAIN="<YOUR_SUBDOMAIN>"
PREVIOUS_IP=$(nslookup $SUBDOMAIN | tail -n2 | grep A | sed s/[^0-9.]//g)
echo "Previous IP:"$PREVIOUS_IP >> $LOG
if [ "$CURRENT_IP" != "$PREVIOUS_IP" ]
then
echo "Current and previous IP differ! Updating FreeDNS..." >> $LOG
wget -q -O /dev/null $UPDATE_URL
echo "DNS updated on:"$(date) >> $LOG
fi
echo "-----------------------" >> $LOG
