diff --git a/base/sysfiles/etc_init.d_functions-ansi.in.txt b/base/sysfiles/etc_init.d_functions-ansi.in.txt index d408662d8..987a40d37 100644 --- a/base/sysfiles/etc_init.d_functions-ansi.in.txt +++ b/base/sysfiles/etc_init.d_functions-ansi.in.txt @@ -1,8 +1,8 @@ # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # -# Filename: package/.../sysfiles/etc_rc.d_functions-ansi.in.txt -# Copyright (C) 2006 - 2008 The OpenSDE Project +# Filename: package/.../sysfiles/etc_init.d_functions-ansi.in.txt +# Copyright (C) 2006 - 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -35,13 +35,11 @@ MOVE_UP="$ESC[1A" # 1 line up (eat last \n) MOVE_LEFT_STATUS="$ESC[$( expr ${#ART_SUCCESS} - 1 )D" # move left the length of $ART_SUCCESS MOVE_LEFT_NEXT="$ESC[$( expr ${#ART_NEXT} - 1 )D" # move left the length of $ART_NEXT -banner() -{ +banner() { $ECHO "$COLOR_BANNER$*$COLOR_NORMAL" } -title() -{ +title() { local x=1 columns= columns=$( if ! stty size -F /dev/tty; then stty size -F /dev/console @@ -59,10 +57,9 @@ title() error=0 } -status() -{ +status() { $ECHO -n "$MOVE_UP$MOVE_EOL$MOVE_LEFT_STATUS" - if [ ${1:-$error} -eq 0 ]; then + if [ "${1:-$error}" -eq 0 ]; then $ECHO "$COLOR_SUCCESS$ART_SUCCESS$COLOR_NORMAL" else $ECHO "$BELL$COLOR_FAILURE$ART_FAILURE$COLOR_NORMAL" diff --git a/base/sysfiles/etc_init.d_functions.in.txt b/base/sysfiles/etc_init.d_functions.in.txt index d4e26faf4..ab036585a 100644 --- a/base/sysfiles/etc_init.d_functions.in.txt +++ b/base/sysfiles/etc_init.d_functions.in.txt @@ -1,8 +1,8 @@ # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # -# Filename: package/.../sysfiles/etc_rc.d_functions.in.txt -# Copyright (C) 2006 - 2008 The OpenSDE Project +# Filename: package/.../sysfiles/etc_init.d_functions.in.txt +# Copyright (C) 2006 - 2009 The OpenSDE Project # # More information can be found in the files COPYING and README. # @@ -15,25 +15,22 @@ if [ -z "$NOCOLOR" ]; then # assuming this terminal supports ANSI escape sequences # - . /etc/rc.d/functions-ansi.in + . /etc/init.d/functions-ansi.in else # if not, use plain text # - banner() - { + banner() { echo "$*" } - title() - { + title() { echo -n "$* ..." error=0 } - status() - { - if [ ${1:-$error} -eq 0 ]; then + status() { + if [ "${1:-$error}" -eq 0 ]; then echo " OK" else echo " FAIL" @@ -43,16 +40,14 @@ fi # flow functions don't change # -check() -{ - $* || error=$? +check() { + "$@" || error=$? } -action() -{ +action() { title "$1" shift - $* || error=$? + "$@" || error=$? status }