From 50abed2750390d43b2544f5320ed2f170fc82d01 Mon Sep 17 00:00:00 2001 From: Luca Bilke Date: Wed, 12 Jun 2024 13:12:51 +0200 Subject: [PATCH] bootstrap: implement directories.txt validation --- bootstrap.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 931d432..a681d42 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -146,10 +146,14 @@ create_directories() { _loop_wrapper "${SCRIPT_DIR}/directories.txt" \ 'Creating directory $(echo $x | cut -d"," -f1)' \ ' + set -e dir=$(echo $x | cut -d"," -f1) mod=$(echo $x | cut -d"," -f2) + [ "$dir" = "$mod" ] && mod="755" + [ -d "${user_home}/${dir}" ] || mkdir -p "${user_home}/${dir}" sudo -u "$username" mkdir -p "${user_home}/${dir}" chmod "${mod}" "${user_home}/${dir}" + set +e ' info "Done!" }