From e9fa29c3008e79de7a7b40852e0235f5aecc2663 Mon Sep 17 00:00:00 2001 From: Bob Nugmanov and Dmitriy Kalinin Date: Thu, 21 Mar 2013 14:59:41 -0700 Subject: [PATCH] fix ubuntu deboostrap --- warden/root/linux/rootfs/ubuntu.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/warden/root/linux/rootfs/ubuntu.sh b/warden/root/linux/rootfs/ubuntu.sh index 01e1e50d..4b644479 100755 --- a/warden/root/linux/rootfs/ubuntu.sh +++ b/warden/root/linux/rootfs/ubuntu.sh @@ -17,18 +17,6 @@ then fi function debootstrap() { - if [ -d $target ] - then - read -p "Target directory already exists. Erase it? " - if [[ $REPLY =~ ^[Yy].*$ ]] - then - rm -rf $target - else - echo "Aborting..." - exit 1 - fi - fi - # -v is too new, revert to old trick # ${VAR+X} will be # X when VAR is unset @@ -68,6 +56,19 @@ then fi target=$1 + +if [ -d $target ] +then + read -p "Target directory already exists. Erase it? " + if [[ $REPLY =~ ^[Yy].*$ ]] + then + rm -rf $target + else + echo "Aborting..." + exit 1 + fi +fi + mkdir -p $target debootstrap