Created
March 29, 2017 19:08
-
-
Save JacobHayes/c5bf31d247c9137d53d238065b27647c to your computer and use it in GitHub Desktop.
Show failed systemd units on login - tweaked from coreos script (removed locksmithd check)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/etc/profile.d/systemd_failed_units.sh | |
# | |
# Only print for interactive shells. | |
if [[ $- == *i* ]]; then | |
FAILED=$(systemctl list-units --state=failed --no-legend) | |
if [[ ! -z "${FAILED}" ]]; then | |
COUNT=$(wc -l <<<"${FAILED}") | |
echo -e "Failed Units: \033[31m${COUNT}\033[39m" | |
awk '{ print " " $1 }' <<<"${FAILED}" | |
fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment