summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/functions.sh')
-rwxr-xr-xsbin/functions.sh25
1 files changed, 13 insertions, 12 deletions
diff --git a/sbin/functions.sh b/sbin/functions.sh
index e301d67..ab39a45 100755
--- a/sbin/functions.sh
+++ b/sbin/functions.sh
@@ -51,7 +51,7 @@ RC_DOT_PATTERN=''
# Import code from the specified addon if it exists
#
import_addon() {
- local addon=${svclib}/addons/$1
+ local addon="${svclib}/addons/$1"
if [[ -r ${addon} ]] ; then
source "${addon}"
return 0
@@ -116,7 +116,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
@@ -132,8 +132,8 @@ esyslog() {
local tag=
if [[ -x /usr/bin/logger ]] ; then
- pri=$1
- tag=$2
+ pri="$1"
+ tag="$2"
shift 2
[[ -z "$*" ]] && return 0
@@ -149,7 +149,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 ))
}
@@ -159,7 +159,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 ))
}
@@ -170,7 +170,7 @@ eoutdent() {
# num defaults to 0
#
esetdent() {
- local i=$1
+ local i="$1"
(( i < 0 )) && (( i = 0 ))
RC_INDENTATION=$(printf "%${i}s" '')
}
@@ -466,10 +466,10 @@ dolisting() {
# save the settings ("optstring") for "option"
#
save_options() {
- local myopts=$1
+ local myopts="$1"
shift
- if [[ ! -d ${svcdir}/options/${myservice} ]] ; then
+ if [[ ! -d "${svcdir}/options/${myservice}" ]] ; then
mkdir -p -m 0755 "${svcdir}/options/${myservice}"
fi
@@ -484,7 +484,7 @@ save_options() {
# by calling the save_options function
#
get_options() {
- if [[ -f ${svcdir}/options/${myservice}/$1 ]] ; then
+ if [[ -f "${svcdir}/options/${myservice}/$1" ]] ; then
echo "$(< ${svcdir}/options/${myservice}/$1)"
fi
@@ -586,7 +586,7 @@ reverse_list() {
# Starts addon.
#
start_addon() {
- local addon=$1
+ local addon="$1"
(import_addon "${addon}-start.sh")
return 0
}
@@ -629,7 +629,7 @@ is_older_than() {
shift
for x in "$@" ; do
- [[ ${x} -nt ${ref} ]] && return 0
+ [[ ${x} -nt "${ref}" ]] && return 0
if [[ -d ${x} ]] ; then
is_older_than "${ref}" "${x}"/* && return 0
@@ -699,6 +699,7 @@ if [[ -z ${EBUILD} ]] ; then
setup_defaultlevels
else
+ setup_defaultlevels
# Should we use colors ?
if [[ $* != *depend* ]] ; then
# Check user pref in portage