diff options
Diffstat (limited to 'sbin/functions.sh')
-rwxr-xr-x | sbin/functions.sh | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/sbin/functions.sh b/sbin/functions.sh index 162dd94..0ca1110 100755 --- a/sbin/functions.sh +++ b/sbin/functions.sh @@ -107,7 +107,7 @@ setup_defaultlevels() { if [[ -f "${svcdir}/softlevel" ]] ; then export SOFTLEVEL=$(< "${svcdir}/softlevel") else - export SOFTLEVEL="${BOOTLEVEL}" + export SOFTLEVEL=${BOOTLEVEL} fi fi @@ -120,7 +120,7 @@ setup_defaultlevels() { # get_libdir() { if [[ -n ${CONF_LIBDIR_OVERRIDE} ]] ; then - CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}" + CONF_LIBDIR=${CONF_LIBDIR_OVERRIDE} elif [[ -x /usr/bin/portageq ]] ; then CONF_LIBDIR=$(/usr/bin/portageq envvar CONF_LIBDIR) fi @@ -136,8 +136,8 @@ esyslog() { local tag= if [[ -x /usr/bin/logger ]] ; then - pri="$1" - tag="$2" + pri=$1 + tag=$2 shift 2 [[ -z "$*" ]] && return 0 @@ -153,7 +153,7 @@ esyslog() { # increase the indent used for e-commands. # eindent() { - local i="$1" + local i=$1 (( i > 0 )) || (( i = RC_DEFAULT_INDENT )) esetdent $(( ${#RC_INDENTATION} + i )) } @@ -163,7 +163,7 @@ eindent() { # decrease the indent used for e-commands. # eoutdent() { - local i="$1" + local i=$1 (( i > 0 )) || (( i = RC_DEFAULT_INDENT )) esetdent $(( ${#RC_INDENTATION} - i )) } @@ -174,7 +174,7 @@ eoutdent() { # num defaults to 0 # esetdent() { - local i="$1" + local i=$1 (( i < 0 )) && (( i = 0 )) RC_INDENTATION=$(printf "%${i}s" '') } @@ -274,7 +274,7 @@ _eend() { local retval=${1:-0} efunc=${2:-eerror} msg shift 2 - if [[ ${retval} == "0" ]]; then + if [[ ${retval} == "0" ]] ; then [[ ${RC_QUIET_STDOUT} == "yes" ]] && return 0 msg="${BRACKET}[ ${GOOD}ok${BRACKET} ]${NORMAL}" else @@ -470,7 +470,7 @@ dolisting() { # save the settings ("optstring") for "option" # save_options() { - local myopts="$1" + local myopts=$1 shift if [[ ! -d "${svcdir}/options/${myservice}" ]] ; then @@ -590,7 +590,7 @@ reverse_list() { # Starts addon. # start_addon() { - local addon="$1" + local addon=$1 (import_addon "${addon}-start.sh") return 0 } @@ -629,7 +629,7 @@ stop_volumes() { # EXAMPLE: if is_older_than a.out *.o ; then ... is_older_than() { local x= - local ref="$1" + local ref=$1 shift for x in "$@" ; do @@ -707,7 +707,7 @@ else # Should we use colors ? if [[ $* != *depend* ]] ; then # Check user pref in portage - RC_NOCOLOR="$(portageq envvar NOCOLOR 2>/dev/null)" + RC_NOCOLOR=$(portageq envvar NOCOLOR 2>/dev/null) [[ ${RC_NOCOLOR} == "true" ]] && RC_NOCOLOR="yes" else # We do not want colors during emerge depend @@ -717,7 +717,7 @@ else fi fi -if [[ -n ${EBUILD} && $* == *depend* ]]; then +if [[ -n ${EBUILD} && $* == *depend* ]] ; then # We do not want stty to run during emerge depend COLS=80 else @@ -727,17 +727,21 @@ else (( COLS > 0 )) || (( COLS = 80 )) # width of [ ok ] == 7 fi -if [[ ${RC_ENDCOL} == "yes" ]]; then +if [[ ${RC_ENDCOL} == "yes" ]] ; then ENDCOL=$'\e[A\e['$(( COLS - 8 ))'C' else ENDCOL='' fi # Setup the colors so our messages all look pretty -if [[ ${RC_NOCOLOR} == "yes" ]]; then +if [[ ${RC_NOCOLOR} == "yes" ]] ; then unset GOOD WARN BAD NORMAL HILITE BRACKET else - GOOD=$'\e[32;01m' + if [[ ${RC_COLORS} == "pink" ]] ; then + GOOD=$'\e[35;01m' + else + GOOD=$'\e[32;01m' + fi WARN=$'\e[33;01m' BAD=$'\e[31;01m' HILITE=$'\e[36;01m' |