mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
19 lines
482 B
Bash
19 lines
482 B
Bash
#!/bin/sh
|
|
|
|
[ "$ACTION" = ifup ] || exit 0
|
|
|
|
config_load voice_client
|
|
config_get bindintf SIP bindintf
|
|
|
|
[ "$INTERFACE" == "$bindintf" ] || exit 0
|
|
|
|
. /lib/functions/network.sh
|
|
|
|
if [ -n "$bindintf" ]; then
|
|
network_get_ipaddr bindaddr "$bindintf"
|
|
[ -z "$bindaddr" ] && network_get_ipaddr6 bindaddr "$bindintf"
|
|
bindaddr="${bindaddr:-0.0.0.0}"
|
|
sed -i "s/bindaddr=.*/bindaddr=$bindaddr/g" /etc/asterisk/sip.conf
|
|
[ -e /var/run/asterisk/asterisk.ctl ] && /etc/init.d/asterisk reload
|
|
fi
|
|
|