#!/bin/bash
source /a/bin/errhandle/err
-_errcatch_cleanup() {
+errcatch-cleanup() {
echo 1 >~/.local/conflink
}
s() { sudo "$@"; }
lnf() { /a/exe/lnf "$@"; }
+
+# 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
- lnf() { ln -sf "$@"; }
+ fast=true
+ shift
elif
[[ $1 ]]; then
echo "error: unrecognized arguments" >&2
exit 0
fi
+if $fast; then
+ lnf() { ln -sf "$@"; }
+fi
+
shopt -s nullglob
shopt -s extglob
shopt -s dotglob
# 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
echo "$0: error: unexpected user"; exit 1
;;
esac
-