coturn - Fix update function name and output nothing if no update is needed
This commit is contained in:
@@ -4,4 +4,4 @@ sc_turnDomain="mydomain.com"
|
|||||||
|
|
||||||
# sf_ipUpdate <NEW IP>
|
# sf_ipUpdate <NEW IP>
|
||||||
# Called when a new external IP is detected
|
# Called when a new external IP is detected
|
||||||
sf_ipUpdate() { :; }
|
sf_updateIp() { :; }
|
||||||
|
@@ -51,6 +51,8 @@ step_10() {
|
|||||||
local lLevelSave=${LOG_LEVEL:?}
|
local lLevelSave=${LOG_LEVEL:?}
|
||||||
local lTimeSave=${LOG_TIME:-}
|
local lTimeSave=${LOG_TIME:-}
|
||||||
local retval=0
|
local retval=0
|
||||||
|
local lSilent=0
|
||||||
|
silent && lSilent=1
|
||||||
|
|
||||||
# Force a visible output level for this step
|
# Force a visible output level for this step
|
||||||
if [ "${1:-}" == "-l" ]; then
|
if [ "${1:-}" == "-l" ]; then
|
||||||
@@ -82,9 +84,8 @@ step_10() {
|
|||||||
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
|
||||||
info "Restarting $toolName"
|
|
||||||
exe /bin/systemctl restart $toolServiceName
|
exe /bin/systemctl restart $toolServiceName
|
||||||
else
|
elif (( ! lSilent )) ; then
|
||||||
info "No update required for ${sc_turnDomain} (via $ipUpdater). Current ip: $confIp"
|
info "No update required for ${sc_turnDomain} (via $ipUpdater). Current ip: $confIp"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user