coturn - configurale function called when external ip is updated

This commit is contained in:
2023-01-18 12:31:52 +01:00
parent 76f82c0c86
commit 655beece68
2 changed files with 5 additions and 0 deletions

View File

@@ -1,3 +1,7 @@
#!/usr/bin/env bash #!/usr/bin/env bash
sc_turnDomain="mydomain.com" sc_turnDomain="mydomain.com"
# sf_ipUpdate <NEW IP>
# Called when a new external IP is detected
sf_ipUpdate() { :; }

View File

@@ -78,6 +78,7 @@ step_10() {
local confIp=`cat "$toolConf" | grep "^external-ip" | cut -d'=' -f2` local confIp=`cat "$toolConf" | grep "^external-ip" | cut -d'=' -f2`
if [ "$pubIp" != "$confIp" ]; then if [ "$pubIp" != "$confIp" ]; then
exe sf_updateIp "${pubIp}"
info "Update required (via $ipUpdater). New public ip: $pubIp" info "Update required (via $ipUpdater). New public ip: $pubIp"
exe sed -i "s/^external-ip[[:space:]]*=.*/external-ip=${pubIp}/" "$toolConf" exe sed -i "s/^external-ip[[:space:]]*=.*/external-ip=${pubIp}/" "$toolConf"
exe sleep 1 exe sleep 1