Skip to content

Instantly share code, notes, and snippets.

@ion1
Created February 1, 2010 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ion1/291860 to your computer and use it in GitHub Desktop.
Save ion1/291860 to your computer and use it in GitHub Desktop.
A “shutdown/reboot scheduled” warning for update-motd
#!/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