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

View File

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