From: Daniel Hokka Zakrisson Date: Sat, 9 Dec 2006 16:02:03 +0000 (+0000) Subject: Make getFileArray handle multiple files as well. X-Git-Tag: release-0.30.212~3 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39597d225451b1d13a2d1a7b3c83060019e799b0;p=util-vserver.git Make getFileArray handle multiple files as well. git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2420 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/scripts/functions b/scripts/functions index 61dbd00..d15cd41 100644 --- a/scripts/functions +++ b/scripts/functions @@ -636,13 +636,17 @@ function getFileValue eval read "$_gfv_var" <"$_gfv_file" } -## Called as 'getFileArray ' +## Called as 'getFileArray +' function getFileArray { - test -r "$2" || return 1 - + local _gfa_var=$1 + local _gfa_file + shift + + findFile _gfa_file "$@" '' + test -n "$_gfa_file" -a -r "$_gfa_file" || return 0 local IFS=$_VS_NEWLINE - eval "$1"='( $(< "$2") )' + eval "$_gfa_var"='( $(< "$_gfa_file") )' } function checkComponents