# functions This file contains functions to be used by most or all
# shell scripts in the /etc/init.d directory.
#
-# $Id: functions,v 1.23 1999/09/02 12:29:17 misiek Exp $
+# $Id: functions,v 1.24 1999/09/03 07:24:27 wiget Exp $
#
# Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
# Hacked by: Greg Galloway and Marc Ewing
[ -z "$COLUMNS" ] && COLUMNS=80
# Colors workaround
-unset termput || :
-if [ "$COLOR_INIT" == "no" ]; then
- termput()
- {
- :
- }
-elif [ ! -d /usr/share/terminfo ]; then
- termput()
- {
+termput()
+{
+ if [ "$COLOR_INIT" == "no" ]; then
+ :
+ elif [ ! -d /usr/share/terminfo ] || \
+ [ ! [ -x /usr/bin/tput -o -x /bin/tput ]; then
if [ "$2" == "1" ]; then echo -ne "\033[0;31m"
elif [ "$2" == "2" ]; then echo -ne "\033[0;32m"
elif [ "$2" == "5" ]; then echo -ne "\033[0;35m"
elif [ "$2" == "6" ]; then echo -ne "\033[0;36m"
elif [ "$2" == "7" ]; then echo -ne "\033[0;37m"
fi
- }
-else
- termput ()
- {
- tput $@
- }
-fi
+ else
+ tput $@
+ fi
+}
# printf equivalent
printf_()