From 58f0c76876652f3b1f8a68915c6f49a8e604830d Mon Sep 17 00:00:00 2001 From: david_williams <david_williams> Date: Sat, 12 Feb 2011 20:32:39 +0000 Subject: [PATCH] improve daily cleanup scripts --- releng.control/removeUtils.shsource | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/releng.control/removeUtils.shsource b/releng.control/removeUtils.shsource index be945a164..89b604cea 100644 --- a/releng.control/removeUtils.shsource +++ b/releng.control/removeUtils.shsource @@ -37,13 +37,13 @@ function removeIf () function removeArtifactsDirIf () { # echo "arg: $1"; - - if [ -z $1 ] + foundDirectory=$1 + if [ -z "${foundDirectory}" ] then echo "ERROR: No argument. This function requires a directory as an argument. " ; return 1; fi - foundDirectory=$1 + nSave=$2 if [ -z $nSave ] @@ -51,7 +51,7 @@ function removeArtifactsDirIf () nSave=1; fi - if [ ! -d $foundDirectory ] + if [ ! \( -d "${foundDirectory}" \) ] then echo "ERROR: " "${foundDirectory}" ", is not a directory. This function requires a directory as an argument. " return 2; -- GitLab