From 15bc5a6fc4311e55c4e0380ddc40d7a60f0af774 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 17 Jun 2009 17:44:35 -0500 Subject: [PATCH] * bin/time, bin/date, bin/reboot-required: use case statement, performance improvement Signed-off-by: Dustin Kirkland --- bin/reboot_required | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/bin/reboot_required b/bin/reboot_required index 76cd6eaa..29e56fa8 100755 --- a/bin/reboot_required +++ b/bin/reboot_required @@ -18,12 +18,14 @@ # along with this program. If not, see . flag="/var/run/reboot-required" -if [ "$1" = "--detail" ]; then - ls -alF "$flag" 2>&1 - exit 0 -elif [ "$1" = "--short" ]; then - [ -e "$flag" ] && printf "Yes" || printf "No" - exit 0 -fi - -[ -e "$flag" ] && printf "\005{=b bW}(@)\005{-} " || exit 0 +case "$1" in + --detail) + ls -alF "$flag" 2>&1 + ;; + --short) + [ -e "$flag" ] && printf "Yes" || printf "No" + ;; + *) + [ -e "$flag" ] && printf "\005{=b bW}(@)\005{-} " || exit 0 + ;; +esac