From 1c5d64c3930b12e8a0af8aa3f8c88b3b43156ddc Mon Sep 17 00:00:00 2001 From: Enrico Scholz Date: Fri, 28 Oct 2005 18:40:39 +0000 Subject: [PATCH] when building new vservers allow empty directories for their roots improved error messages a little bit git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2199 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- util-vserver/scripts/vserver-build.functions | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/util-vserver/scripts/vserver-build.functions b/util-vserver/scripts/vserver-build.functions index 18c3c85..4d78cdd 100644 --- a/util-vserver/scripts/vserver-build.functions +++ b/util-vserver/scripts/vserver-build.functions @@ -105,7 +105,7 @@ function _renameVserverCfg local i for i in "$VDIR" "$SETUP_CONFDIR"; do - test ! -e "$i" || { + test ! -e "$i" || isDirectoryEmpty "$i" || { mv "$i" "$i$suffix" say "Renamed '$i' to '$i$suffix'" } @@ -164,13 +164,9 @@ function base._addGeneratedFile function base.initFilesystem { test -z "$1" || _renameVserverCfg - test isDirectoryEmpty "$VDIR" -a ! -e "$SETUP_CONFDIR" || { - echo \ -"vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR' -exist already; please try to use '--force', or remove them manually" ->&2 - exit 1 - } >&2 + { isDirectoryEmpty "$VDIR" && test ! -e "$SETUP_CONFDIR"; } || colpanic $"\ +vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR' +exist already; please try to use '--force', or remove them manually." mkdir -p -m755 "$VDIR" chattr -t "$VDIR" -- 1.8.1.5