diff options
author | Dave Reisner <d@falconindy.com> | 2011-05-27 09:09:44 -0400 |
---|---|---|
committer | Sebastien Luttringer <seblu@seblu.net> | 2011-05-31 08:08:41 +0200 |
commit | d0340e988f96f38cfb518d88e1e6d6e8a3b1cf8c (patch) | |
tree | bb55713b3bfe6d009e4ae984b3c3da306e878e4a /rc.d | |
parent | dfdf8b683633d89a9c7c7560397c57a8a1594147 (diff) | |
download | initscripts-d0340e988f96f38cfb518d88e1e6d6e8a3b1cf8c.tar.xz |
rc.d: declare ENV as an array
Signed-off-by: Dave Reisner <d@falconindy.com>
Signed-off-by: Sebastien Luttringer <seblu@seblu.net>
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 |