summaryrefslogtreecommitdiffstats
path: root/initscript
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2005-06-21 17:37:54 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2005-06-21 17:37:54 +0000
commit1fb1fc8b8d2272f37af420d6a413ac3d4dd821f2 (patch)
tree17b8607030ff4ccde153fd925c8b49300203b577 /initscript
parent219241ab5223b705ade51485ea9227b0a6089c0d (diff)
update debian initscript to emulate lsb functions
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@139 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'initscript')
-rwxr-xr-xinitscript/Debian/15avahi.in51
1 files changed, 50 insertions, 1 deletions
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: <sebastien.estienne@gmail.com>
#
-. /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