[asterisk-users] Script to automatically update externip. Useful for a host with dynamic public IP

Raj Mathur ( राज माथुर ) raju at linux-delhi.org
Mon Feb 6 21:18:35 CST 2012


On Monday 06 Feb 2012, John Cahill wrote:
>                 logger -s "checksetexternip.sh: External IP address
> has changed, changing /etc/asterisk/sip_general_custom.conf" grep -v
> "externip" /etc/asterisk/sip_general_custom.conf >
> /etc/asterisk/sip_general_custom.conf.tmp echo "externip=$EXTERNIP"
> >> /etc/asterisk/sip_general_custom.conf.tmp cp
> /etc/asterisk/sip_general_custom.conf.tmp
> /etc/asterisk/sip_general_custom.conf rm
> /etc/asterisk/sip_general_custom.conf.tmp

You could also do something like:

  sed -i -e "s/^externip *=.*/externip = $EXTERNIP/"
    /etc/asterisk/sip.conf

Apologies for the wrapped code.

Regards,

-- Raj
-- 
Raj Mathur                          || raju at kandalaya.org   || GPG:
http://otheronepercent.blogspot.com || http://kandalaya.org || CC68
It is the mind that moves           || http://schizoid.in   || D17F



More information about the asterisk-users mailing list