Created
February 1, 2010 17:50
-
-
Save ion1/291860 to your computer and use it in GitHub Desktop.
A “shutdown/reboot scheduled” warning for update-motd
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
#!/bin/sh | |
set -e | |
if [ ! -e /var/run/shutdown.pid ]; then | |
exit 0 | |
fi | |
my_tput() { | |
2>/dev/null tput -Tansi "$@" || : | |
} | |
color_def="$(my_tput sgr0)" | |
color_msg="$(my_tput setaf 1; my_tput bold)" | |
message="A shutdown or a reboot is scheduled for the system!" | |
printf "%s%s%s\n\n" "$color_msg" "$message" "$color_def" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment