I have several virtual domains running on a dynamic IP address. I have been using yi.org to update my primary domain for several years. Recently the ISP has been changing the dynamic IP address more frequently causing my virtual domains to fail until I noticed and manually update them at yi.og.
I was trying to come up with a simple way of updating all the domains. I believe the relevant code is at:
/sbin/e-smith/dynamic-dns/yi
#!/bin/sh
# Description: www.yi.org (free service)
#------------------------------------------------------------
# Send DNS IP address update to yi.org. Ignore DOMAIN
# parameter since yi.org only manages subdomains of yi.org.
#------------------------------------------------------------
IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4
lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"
Yi.org uses the domain as the userid with the same password for each of the domains manged in my yi.org account. Do you think it's safe to copy this line and change the $USERID to the virtual domain name?:
lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"
Also what is the "sed" command doing and is it needed after each of the virtual domain updates? The code change I'm considering would look like this:
#!/bin/sh
# Description: www.yi.org (free service)
#------------------------------------------------------------
# Send DNS IP address update to yi.org. Ignore DOMAIN
# parameter since yi.org only manages subdomains of yi.org.
#------------------------------------------------------------
IPADDR=$1
USERID=$2
PASSWD=$3
DOMAIN=$4
lynx -source -auth="$USERID:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR" | sed -e "s,^,$DATETIME: ," -e "s,<.*\?>,,g"
lynx -source -auth="virtual-domain1.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"
lynx -source -auth="virtual-domain2.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"
lynx -source -auth="virtual-domain3.com:$PASSWD" "http://www.yi.org/bin/dyndns.fcgi?ipaddr=$IPADDR"
I tested the lynx commands without the variables, hardcoding the values for the domains and password. Yi.org updates the time the domain was last changed correctly. Is there a better way to accomplish the updating of multiple virtual domains than my idea? Is the "sed" command needed for the virtual domain updates?
Thanks for Your Help