lots of fixes for trisquel flidas
[distro-setup] / conflink
index 7954a223e06e3020939278ecb92786cb820b1538..139096f507446c0b4fc4357b13e3b8087b651226 100755 (executable)
--- a/conflink
+++ b/conflink
@@ -49,13 +49,13 @@ 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
-            subdir-link-r $dir/subdir_files
+            subdir-link-r $dir/subdir_files
         fi
         local x=( $dir/!(binds|subdir_files|filesystem|machine_specific|..|.) )
         (( ${#x[@]} >= 1 )) || continue
@@ -72,18 +72,21 @@ 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
-        common-file-setup ${all_dirs[@]}
+        common-file-setup ${all_dirs[@]}
         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
-            s chgrp bind /etc/bind/bind-writable
+            s chgrp bind /etc/bind/bind-writable
         fi
-        sudo -u traci "$BASH_SOURCE"
+        if [[ -e /etc/davpass ]] && getent group www-data &>/dev/null; then
+            s chgrp www-data /etc/davpass
+        fi
+        m sudo -H -u traci "$BASH_SOURCE"
         ;;
     traci)
-        common-file-setup ${c_dirs[@]}
+        common-file-setup ${c_dirs[@]}
         ;;
     *)
         echo "$0: error: unexpected user"; exit 1