Koozali.org: home of the SME Server
Legacy Forums => Experienced User Forum => Topic started by: hamishau on October 12, 2004, 06:37:01 AM
-
Hi all,
I am trying to get the script from this page http://www.activeservice.co.uk/sme/contribs/ to update two Zonedit domains. So far I am unsuccessful, and need some advise on how to achieve this.
I have them both set up seperately on Zoneedit, both with an A record "mail" which points to the relevant domain MX record.
At the moment one domain updates properly, except for the MX record, and the other domain only updates the MX record! I am confudes, and think that I might have a syntax issue, but I know NOTHING about scripting, and asking for some assistance.
Thanks in advance,
Hamish
Melbourne, AU
-
Can you post your script so we have something to look at?
-
hamishau,
Since you have already followed the work of Rick Jones, here is the addition for 2 domains (+subs):
- replace Ricks script called zoneedit with the new zoneedit script below
- edit (=set your values to) the 8 variables using pico zoneedit
- check zoneedit rights are set executable
- testrun new zoneedit script once ./zoneedit
#!/bin/sh
# Description: ZoneEdit 2 non-primary-domain updater
#------------------------------------------------------------
# ZoneEdit dynamic DNS update handler.
# updates 2 ZoneEdit domains separate from primary
# DOMAIN1
# DOMAIN2
#------------------------------------------------------------
# assuming the domain names on ZoneEdit are not the primary domain of the SME server,
# we explicitly set all 4 (x2=8) variables here to match the ZoneEdit one. e.g.
# Subdomain names (mail,local) can be updated with the current IP.
# e.g. if you have one subdomain 'mail', use: SUBDOMS=mail
# if you have subdomains 'mail' and 'local', use: SUBDOMSx='mail local'
DOMAIN1=mydomain1.com
USERID1=uidmydomain1
PASSWD1=pwmydomain1
SUBDOMS1='mail local'
DOMAIN2=mydomain2.net
USERID2=uidmydomain2
PASSWD2=pwmydomain2
SUBDOMS2='mail local'
# GO FOR IT NOW ...
# -------------------- update domain1 -----
HOSTS=
for SUB in $SUBDOMS1
do
HOSTS=$SUB.$DOMAIN1,$HOSTS
done
wget -q -O - --http-user=$USERID1 --http-passwd=$PASSWD1 \
http://dynamic.zoneedit.com/auth/dynamic.html?host=$HOSTS |
tr '<>' ' \n' | while read RESULT LINE
do
eval $LINE
logger -t ZoneEdit "$RESULT, $HOST: $TEXT $IP"
done
# -------------------- update domain2 -----
HOSTS=
for SUB in $SUBDOMS2
do
HOSTS=$SUB.$DOMAIN2,$HOSTS
done
wget -q -O - --http-user=$USERID2 --http-passwd=$PASSWD2 \
http://dynamic.zoneedit.com/auth/dynamic.html?host=$HOSTS |
tr '<>' ' \n' | while read RESULT LINE
do
eval $LINE
logger -t ZoneEdit "$RESULT, $HOST: $TEXT $IP"
done
Regards
Reinhold
P.S.: This is "off the cuff" i.e. untested but it should work :-D
-
Hi guys, and thanks for the replies.
I have actually emailed Rick and gotten his feedback on it.
I have put in: HOSTS=www.dom1.com,www.dom2.com,dom1.com,dom2.com,mail.dom1.com,mail.dom2.com (note the lack of spaces)
Just before the "wget" statement, And it works perfectly.
Hamish
Melbourne, AU
-
hamishau,
Good to have the advice from the original author and a simple solution....
...which can however only work if your zoneedit passwords happen to be identical ;-)
Regards
Reinhold
-
Hi Reinhold,
Yes, I had not considered that aspect. In my case they are the same, so no issue. But I have copied the script for safe keeping!
Thanks,
Hamish
Melbourne, AU
-
hamish,
What(ever) "simply works" - works best!
I found that solution "quite refreshingly astonishing" 8-) - simply put :-D
AND I thought I'd just give YOU a REMINDER in case you change those (basically independend) passwords regularly and wonder why it doesn't work in a couple of weeks/month <eg> from now on!
enjoy
Reinhold
-A few lines of code may work wonders ... if you know what you do i.e. -