1
0
Fork 0

Merge branch 'main' of git.snaile.de:luca/bootstrapper

This commit is contained in:
Luca Bilke 2024-06-12 21:42:35 +02:00
commit 0e1fc44416
No known key found for this signature in database
GPG Key ID: C9E851809C1A5BDE
2 changed files with 17 additions and 12 deletions

View File

@ -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!"
}
@ -191,6 +195,7 @@ enable_services() {
finalize() {
gid=$(getent passwd "$username" | cut -d ':' -f 4)
groupname=$(getent group "$gid" | cut -d ':' -f 1)
info "Setting ownership of home directories..."
chown "$username:$groupname" -R "$user_home"
info "Done!"
}

View File

@ -1,14 +1,14 @@
.cache,755
.cache
.config
.config/dwm/autorun.d,755
.local/libexec/,755
.local/log,755
.local/share/,755
.local/state,755
.local/sv,755
.config/dwm/autorun.d
.local/libexec/
.local/log
.local/share/
.local/state
.local/sv
Desktop
Documents/dev
Downloads
Pictures/Screenshots
Videos
.ssh,700
Desktop,755
Documents/dev,755
Downloads,755
Pictures/Screenshots,755
Videos,755