various improvements
[distro-setup] / mail-setup
index 7ce6a0daeddb32bd3bcd1852227d6164b1058004..cdbf9e8ef4216f71453e4d131ee9c40706b7ec20 100755 (executable)
@@ -361,31 +361,8 @@ reload=false
 if [[ -e /var/local/mail-setup-reload ]]; then
   reload=true
 fi
-# update file.
-# if the file changed, ur=true, else false.
-# note: duplicated in brc
-u() {
-  local tmp tmpdir dest="$1"
-  local base="${dest##*/}"
-  local dir="${dest%/*}"
-  if [[ $dir != "$base" ]]; then
-    # dest has a directory component
-    mkdir -p "$dir"
-  fi
-  ur=false # u result
-  tmpdir=$(mktemp -d)
-  cat >$tmpdir/"$base"
-  tmp=$(rsync -ic $tmpdir/"$base" "$dest")
-  if [[ $tmp ]]; then
-    printf "%s\n" "$tmp"
-    ur=true
-    if [[ $dest == /etc/systemd/system/* ]]; then
-      touch /var/local/mail-setup-reload
-      reload=true
-    fi
-  fi
-  rm -rf $tmpdir
-}
+
+source /a/bin/fai/fai/config/distro-install-common/bash-misc-funcs
 setini() {
   key="$1" value="$2" section="$3"
   file="/etc/radicale/config"