bootstrap: implement directories.txt validation
This commit is contained in:
parent
585fe39d7b
commit
50abed2750
|
@ -146,10 +146,14 @@ create_directories() {
|
||||||
_loop_wrapper "${SCRIPT_DIR}/directories.txt" \
|
_loop_wrapper "${SCRIPT_DIR}/directories.txt" \
|
||||||
'Creating directory $(echo $x | cut -d"," -f1)' \
|
'Creating directory $(echo $x | cut -d"," -f1)' \
|
||||||
'
|
'
|
||||||
|
set -e
|
||||||
dir=$(echo $x | cut -d"," -f1)
|
dir=$(echo $x | cut -d"," -f1)
|
||||||
mod=$(echo $x | cut -d"," -f2)
|
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}"
|
sudo -u "$username" mkdir -p "${user_home}/${dir}"
|
||||||
chmod "${mod}" "${user_home}/${dir}"
|
chmod "${mod}" "${user_home}/${dir}"
|
||||||
|
set +e
|
||||||
'
|
'
|
||||||
info "Done!"
|
info "Done!"
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue