Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Syntholis on November 30, 2004, 07:08:51 PM
-
Hey guys... I use DNSMADEEASY for my DNS, and it allows dynamic IPs as well...
this is a simple linux script for updating the IP automatically, but it won't work for me, since my servers are behind a firewall... can someone help me change the one "section" to use the feedback from a web response that provides the IP.
#!/bin/sh
#
# dnsmadeeasy-update.sh
#
# This script updates Dynamic DNS records on DNE Made Easy's
# DNS servers. You must have wget installed for this to work.
#
# Author: Jeff Larkin <fu_fish@users.sourceforge.net>
# Last Modified: 08-February-2002
#
# This script is released as public domain in hope that it will
# be useful to others using DNS Made Easy. It is provided
# as-is with no warranty implied. Sending passwords as a part
# of an HTTP request is inherently insecure. I take no responsibilty
# if your password is discovered by use of this script.
#
# This is the e-mail address that you use to login
DMEUSER=<username>
# This is your password
DMEPASS=<password>
# This is the unique number for the record that you are updating.
# This number can be obtained by clicking on the DDNS link for the
# record that you wish to update; the number for the record is listed
# on the next page.
DMEID=<record number>
# Obtain current ip address
IPADDR=ifconfig eth0 | grep inet | awk '{print $2}' | awk -F : '{print $2}'
if wget -q -O /proc/self/fd/1 http://www.dnsmadeeasy.com/servlet/updateip?username=$DMEUSER\&password=$DMEPASS\&id=$DMEID\&ip=$IPADDR | grep good > /dev/null; then
logger -t DNS-Made-Easy -s "DNS Record Updated Successfully"
else
logger -t DNS-Made-Easy -s "Problem updating DNS record."
fi
# David Harris's script for dynodns.net was used as an example
# in writing this script.
I need to change the section that reads:
IPADDR=ifconfig eth0 | grep inet | awk '{print $2}' | awk -F : '{print $2}'
to use the response from the command:
http://www.dnsmadeeasy.com/myip.jsp (which will return my IP)
Thanx
-
DME Update script for Dnsmadeeasy
1: download the script from http://www.smood.com/dme_update/current.tgz and extract all to:
/etc/dmeupdate/
2: create domain record:
cat > /etc/dmeupdate/records/www.yourdomain.com
3: edit your domain record:
pico /etc/dmeupdate/records/www.yourdomain.com
now enter your data like this:
user@yourdomain.com
userpassword
domain ID
now save this!
4: set cronjob:
pico /etc/e-smith/templates/etc/crontab/25dmeupdate
enter this:
0-59/5 * * * * root /etc/dmeupdate/dme_update
now save this!
5: expand template:
/sbin/e-smith/expand-template /etc/crontab
now your done!
i have done all this described below, but the update does not work with cronjob.
the script alone (saved in /etc/dmeupdate/dme_update) work fine, if i start him self with ./dme_update the update are ok.
where are the bug and how to make it working?
it would be nice to have this funktion in server-manager also, have seen an contrib for DynDNS - but this does not work with DnsMadeeasy.
thanx zoran