]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
termput() check for /usr/share/terminfo and tput everytime
authorArtur Frysiak <artur@frysiak.net>
Fri, 3 Sep 1999 07:24:27 +0000 (07:24 +0000)
committerArtur Frysiak <artur@frysiak.net>
Fri, 3 Sep 1999 07:24:27 +0000 (07:24 +0000)
svn-id: @510

rc.d/init.d/functions

index 918b7e760dcafaf49b994dfa9f1e697301306fb9..cbcf7b959bbb506988bd11766af21654a550c1b2 100644 (file)
@@ -1,7 +1,7 @@
 # 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
@@ -15,28 +15,22 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin"
 [ -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_()
This page took 0.17322 seconds and 4 git commands to generate.