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.
@Rolando For Asterisk I needed the (changed) public IP to be active immediately, so that Asterisk can determine it's external IP.
Nice succinct ddclient-post script to update IP to /etc/hosts (I have not tested)
Just that the information I think Asterisk also needs that info in something like:
/etc/asterisk/sip_general_custom.conf icesupport=yes stunaddr=stun.l.google.com:19302 srvlookup=yes allowguest=yes ;externip=1.2.3.4 externhost=subdom.dom.tld localnet=192.168.0.0/16
But also Debian Sources has a script (an ascii file) for this sample-etc_dhcpc_dhcpcd-eth0.exe The file has an 'e' atribute that can be removed before edit/nameing with chattr -e sample-etc_dhcpc_dhcpcd-eth0.exe
chattr +e dhcpcd-eth0
apparently the eth0 part is supposed to get changed to match your iface , and of course chmod +x dhcpcd-eth0
to make it ececutable.
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