Browse Source

sysfiles: fixed some bugs in functions.in and fixed indentation

user/amery/runit-rework
Alejandro Mery 16 years ago committed by Alejandro Mery
parent
commit
dd0791ff0c
  1. 15
      base/sysfiles/etc_init.d_functions-ansi.in.txt
  2. 27
      base/sysfiles/etc_init.d_functions.in.txt

15
base/sysfiles/etc_init.d_functions-ansi.in.txt

@ -1,8 +1,8 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN --- # --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# #
# Filename: package/.../sysfiles/etc_rc.d_functions-ansi.in.txt # Filename: package/.../sysfiles/etc_init.d_functions-ansi.in.txt
# Copyright (C) 2006 - 2008 The OpenSDE Project # Copyright (C) 2006 - 2009 The OpenSDE Project
# #
# More information can be found in the files COPYING and README. # 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_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 MOVE_LEFT_NEXT="$ESC[$( expr ${#ART_NEXT} - 1 )D" # move left the length of $ART_NEXT
banner() banner() {
{
$ECHO "$COLOR_BANNER$*$COLOR_NORMAL" $ECHO "$COLOR_BANNER$*$COLOR_NORMAL"
} }
title() title() {
{
local x=1 columns= local x=1 columns=
columns=$( if ! stty size -F /dev/tty; then columns=$( if ! stty size -F /dev/tty; then
stty size -F /dev/console stty size -F /dev/console
@ -59,10 +57,9 @@ title()
error=0 error=0
} }
status() status() {
{
$ECHO -n "$MOVE_UP$MOVE_EOL$MOVE_LEFT_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" $ECHO "$COLOR_SUCCESS$ART_SUCCESS$COLOR_NORMAL"
else else
$ECHO "$BELL$COLOR_FAILURE$ART_FAILURE$COLOR_NORMAL" $ECHO "$BELL$COLOR_FAILURE$ART_FAILURE$COLOR_NORMAL"

27
base/sysfiles/etc_init.d_functions.in.txt

@ -1,8 +1,8 @@
# --- SDE-COPYRIGHT-NOTE-BEGIN --- # --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# #
# Filename: package/.../sysfiles/etc_rc.d_functions.in.txt # Filename: package/.../sysfiles/etc_init.d_functions.in.txt
# Copyright (C) 2006 - 2008 The OpenSDE Project # Copyright (C) 2006 - 2009 The OpenSDE Project
# #
# More information can be found in the files COPYING and README. # More information can be found in the files COPYING and README.
# #
@ -15,25 +15,22 @@
if [ -z "$NOCOLOR" ]; then if [ -z "$NOCOLOR" ]; then
# assuming this terminal supports ANSI escape sequences # assuming this terminal supports ANSI escape sequences
# #
. /etc/rc.d/functions-ansi.in . /etc/init.d/functions-ansi.in
else else
# if not, use plain text # if not, use plain text
# #
banner() banner() {
{
echo "$*" echo "$*"
} }
title() title() {
{
echo -n "$* ..." echo -n "$* ..."
error=0 error=0
} }
status() status() {
{ if [ "${1:-$error}" -eq 0 ]; then
if [ ${1:-$error} -eq 0 ]; then
echo " OK" echo " OK"
else else
echo " FAIL" echo " FAIL"
@ -43,16 +40,14 @@ fi
# flow functions don't change # flow functions don't change
# #
check() check() {
{ "$@" || error=$?
$* || error=$?
} }
action() action() {
{
title "$1" title "$1"
shift shift
$* || error=$? "$@" || error=$?
status status
} }

Loading…
Cancel
Save