exit $1
}
-
+# maybe verbose
m() {
- "$@"
+ local out
+ out=$("$@" 2>&1)
+ if [[ $out ]]; then
+ printf "output of: %s\n%s\n" "$*" "$out"
+ fi
}
+# verbose
v() {
echo "$*"
"$@"
common-file-setup() {
- local dir fs f reload_systemd
+ local dir fs f
local -a link_glob
local -A restart_services
- reload_systemd=false
for dir in "$@"; do
case $user in
iank)
-
+ reload_systemd=false
old-files-cleanup
/a/bin/ds/install-my-scripts
--exclude='/etc/exim4/passwd*'
--exclude='/etc/exim4/*.pem'
${rsync_args[@]} / )
- echo "${cmd[@]@Q}"
- "${cmd[@]}" | tee $tmpf
+ "${cmd[@]}" >$tmpf
+ if [[ -s $tmpf ]]; then
+ printf "output of: %s\n" "${cmd[*]}"
+ cat $tmpf
+ fi
while read -r line; do
file="${line:12}"
if [[ -e /p/c/user-specific/prometheus ]]; then
if getent passwd prometheus &>/dev/null; then
- v rsync -clpgoDiSAX --chmod=g+r --chown=root:prometheus /p/c/user-specific/prometheus/prometheus-pass /etc
- v rsync -clpgoDiSAX --chmod=g+r --chown=root:prometheus /p/c/user-specific/prometheus/prometheus/ssl/* /etc/prometheus/ssl
+ m rsync -clpgoDiSAX --chmod=g+r --chown=root:prometheus /p/c/user-specific/prometheus/prometheus-pass /etc
+ m rsync -clpgoDiSAX --chmod=g+r --chown=root:prometheus /p/c/user-specific/prometheus/prometheus/ssl/* /etc/prometheus/ssl
fi
fi
if [[ -e /p/c/user-specific/www-data ]]; then
if getent passwd www-data &>/dev/null; then
- v rsync -clpgoDiSAX --chmod=g+r --chown=root:www-data /p/c/user-specific/www-data/* /etc
+ m rsync -clpgoDiSAX --chmod=g+r --chown=root:www-data /p/c/user-specific/www-data/* /etc
fi
fi
if [[ -e /p/c/user-specific/znc ]]; then
if getent group znc &>/dev/null; then
- v rsync -rclpgoDiSAX --chown=znc:znc /p/c/user-specific/znc/ /var/lib/znc
+ m rsync -rclpgoDiSAX --chown=znc:znc /p/c/user-specific/znc/ /var/lib/znc
fi
fi
# "var/lib/bind/dsset-*"
if [[ -e /p/c/user-specific/bind ]]; then
if getent group bind &>/dev/null; then
- v rsync -clpgoDiSAX --chmod=g+r --chown=root:bind /p/c/user-specific/bind/etc/bind/* /etc/bind
- v rsync -clpgoDiSAX --chmod=g+r --chown=root:bind /p/c/user-specific/bind/var/lib/bind/* /var/lib/bind
+ m rsync -clpgoDiSAX --chmod=g+r --chown=root:bind /p/c/user-specific/bind/etc/bind/* /etc/bind
+ m rsync -clpgoDiSAX --chmod=g+r --chown=root:bind /p/c/user-specific/bind/var/lib/bind/* /var/lib/bind
fi
fi
# this folder strangely requires ownership as icecast2 (and icecast2 group is icecast without the 2).
if [[ -d /etc/icecast2 && -e /p/c/user-specific/icecast ]]; then
- v rsync -clgoDiSAX --chmod=g+r --chown=root:icecast /p/c/user-specific/icecast2/icecast.xml /etc/icecast2
+ m rsync -clgoDiSAX --chmod=g+r --chown=root:icecast /p/c/user-specific/icecast2/icecast.xml /etc/icecast2
fi
# disabled