Created
June 25, 2015 19:20
-
-
Save derak-kilgo/6ee43d582f97f5ce7b41 to your computer and use it in GitHub Desktop.
noip.com cli update script
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 | |
# Updates ip address in the noip DDNS serivce. | |
# Assumes curl + gnu tools | |
# Param descriptions taken from API docs. | |
# http://www.noip.com/integrate/request | |
#Config | |
TARGETNIC="wlan0" | |
#The IP address to which the host(s) will be set. | |
#If no IP address is supplied the WAN address connecting to our system will be used. | |
#Clients behind NAT, for example, would not need to supply an IP address | |
MYIP="$(ifconfig $TARGETNIC | grep inet | awk '{print $2}' | sed 's/addr://')" | |
#Username and password associated with the hosts that are to be updated. | |
#No-IP [can] use an email address as the username. Email addresses will be no longer than 50 characters. | |
NOIPUSER="your-username" | |
NOIPPASS="your password" | |
#The hostname(s) (host.domain.com) or group(s) (group_name) to be updated . | |
#If updating multiple hostnames or groups use a comma separated list. | |
NOIPHOST="noip-host-to-update" | |
#When making an update it is important that your http request include an HTTP User-Agent to help No-IP identify different clients that access the system. | |
#Clients that do not supply a User-Agent risk being blocked from the system. | |
NOIPUSERAGENT="bash-curl-cron/1.0 [email protected]" | |
CURLCMD="curl --user-agent $NOIPUSERAGENT --silent https://$NOIPUSER:[email protected]/nic/update?hostname=$NOIPHOST&myip=$MYIP" | |
echo "Running $CURLCMD" | |
RESULT="$($CURLCMD)" | |
echo "$RESULT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment