From 3a386d7ae71eee790300114dc1b01afa1e2ce2ed Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Tue, 19 Oct 2004 23:59:15 +0000 Subject: [PATCH] getFileValue(): modified to accept a list of candidates git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1754 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/functions | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/util-vserver/scripts/functions b/util-vserver/scripts/functions index 391961b..e794173 100644 --- a/util-vserver/scripts/functions +++ b/util-vserver/scripts/functions @@ -452,11 +452,16 @@ function isVserverRunning return 0 } -## Called as 'getFileValue ' +## Called as 'getFileValue +' function getFileValue { - test -r "$2" || return 0 - eval read "$1" <"$2" + local var=$1 + local file + shift + + findFile file "$@" '' + test "$file" -a -r "$file" || return 0 + eval read "$var" <"$file" } ## Called as 'getFileArray ' -- 1.8.1.5