* bin/time, bin/date, bin/reboot-required: use case statement, performance

improvement


Signed-off-by: Dustin Kirkland <kirkland@canonical.com>
This commit is contained in:
Dustin Kirkland 2009-06-17 17:44:35 -05:00
commit 15bc5a6fc4

View file

@ -18,12 +18,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
flag="/var/run/reboot-required" flag="/var/run/reboot-required"
if [ "$1" = "--detail" ]; then case "$1" in
--detail)
ls -alF "$flag" 2>&1 ls -alF "$flag" 2>&1
exit 0 ;;
elif [ "$1" = "--short" ]; then --short)
[ -e "$flag" ] && printf "Yes" || printf "No" [ -e "$flag" ] && printf "Yes" || printf "No"
exit 0 ;;
fi *)
[ -e "$flag" ] && printf "\005{=b bW}(@)\005{-} " || exit 0
[ -e "$flag" ] && printf "\005{=b bW}(@)\005{-} " || exit 0 ;;
esac