diff --git a/contrib/scripts/NM-log b/contrib/scripts/NM-log index 608fc386ab..7a35b17b10 100755 --- a/contrib/scripts/NM-log +++ b/contrib/scripts/NM-log @@ -13,7 +13,13 @@ # # You can pass multiple filenames. -show-journal() { +if [[ "$_" == "$0" ]]; then + NM_not_sourced=1 +else + unset NM_not_sourced +fi + +NM-show-journal() { local since="$(systemctl show NetworkManager | sed -n 's/^ExecMainStartTimestamp=\(.*\) [A-Z0-9]\+$/\1/p')" if [[ "$since" == "" ]]; then @@ -24,29 +30,37 @@ show-journal() { fi } -colorize() { +NM-colorize() { if [[ "$NM_LOG_NO_COLOR" == "" ]]; then - GREP_COLOR='01;33' grep --color=always '^\|^\(.* \)\?<\(warn>\|info> \|error>\) \(.*\.*$\)\?' | \ - GREP_COLOR='01;37' grep --color=always '^\|\\|info> \|error>\) \(.*\.*$\)\?' | \ + GREP_COLOR='01;37' grep -a --color=always '^\|\