coturn - Fix update function name and output nothing if no update is needed

This commit is contained in:
2023-03-02 14:08:20 +01:00
parent 5e4b7fbb07
commit fe0d4ca751
2 changed files with 4 additions and 3 deletions

View File

@@ -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() { :; }

View File

@@ -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