diff options
author | Donatas Abraitis <donatas@opensourcerouting.org> | 2023-09-18 10:05:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-18 10:05:33 +0200 |
commit | 35d97877e169b6b78570564af814aa32396a42c5 (patch) | |
tree | 115c3cc631ab75e22d44923e78a560ad42ab95d6 | |
parent | Merge pull request #14409 from pguibert6WIND/donotuse_redistribute_table_on_n... (diff) | |
parent | tools: make --quiet actually suppress output (diff) | |
download | frr-35d97877e169b6b78570564af814aa32396a42c5.tar.xz frr-35d97877e169b6b78570564af814aa32396a42c5.zip |
Merge pull request #14418 from bisdn/jogo_frrcommon_fix_stop_quiet
tools: make --quiet actually suppress output
-rwxr-xr-x | tools/frrcommon.sh.in | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/frrcommon.sh.in b/tools/frrcommon.sh.in index f1f701190..00b63a78e 100755 --- a/tools/frrcommon.sh.in +++ b/tools/frrcommon.sh.in @@ -207,8 +207,8 @@ daemon_stop() { [ -z "$fail" -a -z "$pid" ] && fail="pid file is empty" [ -n "$fail" ] || kill -0 "$pid" 2>/dev/null || fail="pid $pid not running" - if [ -n "$fail" ] && [ "$2" != "--quiet" ]; then - log_failure_msg "Cannot stop $dmninst: $fail" + if [ -n "$fail" ]; then + [ "$2" = "--quiet" ] || log_failure_msg "Cannot stop $dmninst: $fail" return 1 fi @@ -220,11 +220,11 @@ daemon_stop() { [ $(( cnt -= 1 )) -gt 0 ] || break done if kill -0 "$pid" 2>/dev/null; then - log_failure_msg "Failed to stop $dmninst, pid $pid still running" + [ "$2" = "--quiet" ] || log_failure_msg "Failed to stop $dmninst, pid $pid still running" still_running=1 return 1 else - log_success_msg "Stopped $dmninst" + [ "$2" = "--quiet" ] || log_success_msg "Stopped $dmninst" rm -f "$pidfile" return 0 fi |