From: Sebastien Estienne Date: Tue, 21 Jun 2005 17:37:54 +0000 (+0000) Subject: update debian initscript to emulate lsb functions X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=1fb1fc8b8d2272f37af420d6a413ac3d4dd821f2;p=catta update debian initscript to emulate lsb functions git-svn-id: file:///home/lennart/svn/public/avahi/trunk@139 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/initscript/Debian/15avahi.in b/initscript/Debian/15avahi.in index 6116078..00d8fb6 100755 --- a/initscript/Debian/15avahi.in +++ b/initscript/Debian/15avahi.in @@ -6,7 +6,56 @@ # Authors: # -. /lib/lsb/init-functions +if [ -f /lib/lsb/init-functions ] +then + . /lib/lsb/init-functions +else + # int log_begin_message (char *message) + log_begin_msg () { + if [ -z "$1" ]; then + return 1 + fi + echo " * $@" + } + + # int log_end_message (int exitstatus) + log_end_msg () { + + # If no arguments were passed, return + [ -z "$1" ] && return 1 + + # Only do the fancy stuff if we have an appropriate terminal + # and if /usr is already mounted + TPUT=/usr/bin/tput + EXPR=/usr/bin/expr + if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then + COLS=`$TPUT cols` + if [ -n "$COLS" ]; then + COL=`$EXPR $COLS - 7` + else + COL=73 + fi + UP=`$TPUT cuu1` + END=`$TPUT hpa $COL` + START=`$TPUT hpa 0` + RED=`$TPUT setaf 1` + NORMAL=`$TPUT op` + if [ $1 -eq 0 ]; then + echo "$UP$END[ ok ]" + else + echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]" + fi + else + if [ $1 -eq 0 ]; then + echo " ...done." + else + echo " ...fail!" + fi + fi + return $1 + } + +fi #set -e