From d0340e988f96f38cfb518d88e1e6d6e8a3b1cf8c Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Fri, 27 May 2011 09:09:44 -0400 Subject: rc.d: declare ENV as an array Signed-off-by: Dave Reisner Signed-off-by: Sebastien Luttringer --- rc.d | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'rc.d') diff --git a/rc.d b/rc.d index 55871b1..af29574 100755 --- a/rc.d +++ b/rc.d @@ -46,13 +46,13 @@ case $1 in shift # set same environment variables as init runlevel=$(/sbin/runlevel) - ENV="PATH='/bin:/usr/bin:/sbin:/usr/sbin'" - ENV+=" PREVLEVEL='${runlevel:0:1}'" - ENV+=" RUNLEVEL='${runlevel:2:1}'" - ENV+=" CONSOLE='${CONSOLE:-/dev/console}'" - ENV+=" TERM='${TERM}'" + ENV=("PATH=/bin:/usr/bin:/sbin:/usr/sbin" + "PREVLEVEL=${runlevel%% *}" + "RUNLEVEL=${runlevel##* }" + "CONSOLE=${CONSOLE:-/dev/console}" + "TERM=$TERM") for i; do - [[ -x "/etc/rc.d/$i" ]] && cd / && eval /usr/bin/env -i $ENV "/etc/rc.d/$i" "$action" + [[ -x "/etc/rc.d/$i" ]] && cd / && /usr/bin/env -i "${ENV[@]}" "/etc/rc.d/$i" "$action" (( ret += !! $? )) # clamp exit value to 0/1 done esac -- cgit v1.2.3