Skip to content

Commit

Permalink
Fix quiet mode
Browse files Browse the repository at this point in the history
We only need to output initlog messages if output occurs on
/dev/console.

Fixes: f70ac4c ("Remove initlog")
Signed-off-by: Alexey Gladkov <[email protected]>
  • Loading branch information
legionus committed Apr 17, 2024
1 parent 6c85778 commit d1be1ae
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions data/etc/rc.d/init.d/functions
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,11 @@ echo_passed()
# Log that something succeeded
success()
{
[ -z "${INITLOG_FILE-}" ] ||
message "$1 succeeded" >"$INITLOG_FILE"
[ "${RDLOG-}" != 'console' ] ||
if [ "${RDLOG-}" = 'console' ]; then
[ -z "${INITLOG_FILE-}" ] ||
message "$1 succeeded" >"$INITLOG_FILE"
return 0
fi
echo_success
echo_newline
return 0
Expand All @@ -455,10 +456,11 @@ success()
failure()
{
local rc=$?
[ -z "${INITLOG_FILE-}" ] ||
message "$1 failed" >"$INITLOG_FILE"
[ "${RDLOG-}" != 'console' ] ||
if [ "${RDLOG-}" = 'console' ]; then
[ -z "${INITLOG_FILE-}" ] ||
message "$1 failed" >"$INITLOG_FILE"
return $rc
fi
echo_failure
echo_newline
return $rc
Expand All @@ -468,10 +470,11 @@ failure()
passed()
{
local rc=$?
[ -z "${INITLOG_FILE-}" ] ||
message "$1 passed" >"$INITLOG_FILE"
[ "${RDLOG-}" != 'console' ] ||
if [ "${RDLOG-}" = 'console' ]; then
[ -z "${INITLOG_FILE-}" ] ||
message "$1 passed" >"$INITLOG_FILE"
return $rc
fi
echo_passed
echo_newline
return $rc
Expand Down

0 comments on commit d1be1ae

Please sign in to comment.