diff --git a/bootstrap/sbin/rebuild_system_from_scratch.sh b/bootstrap/sbin/rebuild_system_from_scratch.sh index 3e2997d693477370fc8d5d860f9e21fccf2c2d9f..9d5502ef1aa704919d2804cc0548bf5bc7ae9487 100755 --- a/bootstrap/sbin/rebuild_system_from_scratch.sh +++ b/bootstrap/sbin/rebuild_system_from_scratch.sh @@ -7,6 +7,9 @@ if [ ! -d ${HOME_DIR}/bootstrap ]; then exit 1 fi +# Save for the moment when tango will be cloned. +OLD_HOME_DIR=${HOME_DIR}.old + trap ' exit ${?} ' ABRT EXIT HUP INT TERM QUIT ERR @@ -22,9 +25,9 @@ function build_lofar_images() popd } -function remove_tango_dir() +function move_tango_dir_out_of_the_way() { - rm -rf ${HOME_DIR} + mv ${HOME_DIR} ${OLD_HOME_DIR} } function remove_images() @@ -90,9 +93,10 @@ stop_images # Clean out the Docker volumes. clean_images -# Delete the tango repo dir. Notice that this also deletes the bootstrap dir -# which contains this and the helper scripts. -remove_tango_dir +# Move the tango repo dir out of the way. +echo "-> Moving the tango directory ${HOME_DIR} out of the way..." +move_tango_dir_out_of_the_way +echo -e "\tDone.\n" # Therefore, since the tango/boostrap dir is now gone, pull the repo first # and then continue.