X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=conflink;h=38aacf02ac885a8a8c2ff0da27043c007373f457;hb=a83e91030893a823da5f057d6b848dbac7593f01;hp=7a597e3d86db0c970805531509a99b98c527fb0b;hpb=1ad20724a44a0ee3adc2f4a1d002850fbad7a372;p=distro-setup diff --git a/conflink b/conflink index 7a597e3..38aacf0 100755 --- a/conflink +++ b/conflink @@ -49,9 +49,9 @@ common-file-setup() { local dir fs x bdir f dst for dir in "$@"; do fs=$dir/filesystem - if [[ -e $fs && $USER == ian ]]; then + if [[ -e $fs && $USER =~ ^iank?$ ]]; then # note, symlinks get resolved, not copied. - m s cp -RLT --preserve=mode,timestamps $fs / + s tar --mode=g-s --owner=0 --group=0 -cz -C $fs . | s tar -xz -C / fi if [[ -e $dir/subdir_files ]]; then @@ -72,17 +72,28 @@ done c_dirs=(/a/c{,/machine_specific/$HOSTNAME}) case $USER in - ian) + ian|iank) # p needs to go first so .ssh link is created, then config link inside it m common-file-setup ${all_dirs[@]} + + #### begin special extra stuff #### + install -d -m700 ~/gpg-agent-socket if [[ -d /etc/bind/bind-writable ]]; then # need bind writable dir for nsupdate, or else we get # named[20823]: /etc/bind/db.iank.pw.jnl: create: permission denied m s chgrp bind /etc/bind/bind-writable fi + files=(/etc/bind/[Kk]*) + if [[ -e $files ]]; then + m s chgrp bind ${files[@]} + fi if [[ -e /etc/davpass ]] && getent group www-data &>/dev/null; then s chgrp www-data /etc/davpass fi + ##### end special extra stuff ##### + + + m sudo -H -u traci "$BASH_SOURCE" ;; traci)