various fixes
[distro-setup] / conflink
index d72f98c29e775a1aa7b6bbf9c0a7689687864c3c..55d7a02489dc6b1d1ae3cbf7d0f3152778d73215 100755 (executable)
--- a/conflink
+++ b/conflink
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 source /a/bin/errhandle/err
-_errcatch_cleanup() {
+errcatch-cleanup() {
   echo 1 >~/.local/conflink
 }
 
@@ -24,12 +24,13 @@ m() {
 s() { sudo "$@"; }
 
 lnf() { /a/exe/lnf "$@"; }
-now=$(date +%s)
-f=~/.local/conflink
-fast=false
-if [[ -e $f ]] && (( $(stat -c %Y $f) > $now - 60*60*24 )); then
-  fast=true
-fi
+
+# error prone
+#f=~/.local/conflink
+# fast=false
+# if [[ -e $f ]] && (( $(stat -c %Y $f) > $now - 60*60*24 )); then
+#   fast=true
+# fi
 if [[ $1 == -f ]]; then # f for fast
   fast=true
   shift
@@ -87,10 +88,13 @@ common-file-setup() {
       # but I haven't looked at the symlinks.
       # s rsync -n -ahviSAXPH --specials --devices --chown=root:root --chmod=g-s $fs /
       # note, symlinks get resolved, not copied.
-      if s tar --mode=g-s --owner=0 --group=0 -cz -C $fs . | s tar -dz -C / | grep /etc/systemd &>/dev/null; then
+      if s tar --anchored \
+           --exclude etc/dovecot/users \
+           --exclude etc/exim4/passwd \
+           --exclude etc/exim4/*.pem \
+           --mode=g-s --owner=0 --group=0 -cz -C $fs . | s tar -dz -C / | grep /etc/systemd &>/dev/null; then
         systemd_reload=true
       fi
-      s tar --mode=g-s --owner=0 --group=0 -cz -C $fs . | s tar -xz -C /
     fi
 
     if [[ -e $dir/subdir_files ]]; then