Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is there any way to force ddclient to run some script on succcessful update? No-IP client have that feature, but I must use dyndns service.

Thanks in advance.

share|improve this question
add comment

3 Answers

This page says you can configure a postscript-parameter in ddclient.conf:

postscript=/usr/local/sbin/do-it-after-ddclient-change.sh
share|improve this answer
add comment

I haven't used this option, but ddclient does have a postscript option. Per the documentation, ddclient will run the script specified in the postscript option, passing in the new IP. Peeking in the ddclient Perl code, the script is called via system().

share|improve this answer
add comment

The IP is given as argument. For Asterisk I needed the (changed) public IP to be active immediately, so that Asterisk can determine it's external IP. I accomplished this by editting the /etc/hosts file with the post script. Replace sip.foo.net with your own.

#!/bin/sh
#
# Update hosts file with changed IP
#
IP=$1

D=sip.foo.net
DOMAIN=`echo "$D" | sed 's/\./\\\\./g'`
sed -i_bak -e "/[\t]$DOMAIN/d" /etc/hosts

echo "$IP\t$D" >>/etc/hosts
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.