Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:obi12341
dyndns-inwx
ip.sh
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ip.sh of Package dyndns-inwx
#!/bin/bash #------------------------------------------------------------------------------------------------------------ # Config #------------------------------------------------------------------------------------------------------------ LOCATION="/home/obi/inwx" # your working directory IP_FETCH_URL="http://www.whatismyip.com/automation/n09230945.asp" # can also use e.g whatismyip.org NS_ENT_ID="" # here you need to enter your NS_Entry ID USER="" # your login data PASS="" # if [ ! -f $LOCATION/updatedomainlastip ]; then touch $LOCATION/updatedomainlastip fi current_ip=$(cat $LOCATION/updatedomainlastip) rm $LOCATION/currentip wget --output-document=$LOCATION/currentip $IP_FETCH_URL 2>/dev/null export RC=$? if [ ! "$RC" = "0" ]; then echo "FAILED to get Public IP! Host: $IP_FETCH_URL" exit 1 fi wan_ip=`cat $LOCATION/currentip` if [ ! "$wan_ip" == "$current_ip" ]; then wget -q --user-agent="Mozilla/4.0" \ --header="Host: api.domrobot.com" \ --header="Content-Type: text/xml" \ --post-data="$(cat $LOCATION/updatedata.xml | sed "s/%wan_ip%/$wan_ip/g;s/%ns_ent_id%/$NS_ENT_ID/g;s/%pass%/$PASS/g;s/%user%/$USER/g")" \ --no-check-certificate -O - \ https://api.domrobot.com/xmlrpc/nameserver echo $wan_ip > $LOCATION/updatedomainlastip else echo "IP has not changed since last update"; fi
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor