X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=install-my-scripts;fp=install-my-scripts;h=dd52266a90fff8f16d08b427fd48d7902d956d5c;hb=95eb9558206f8287febab80dd3f51d168a3ca831;hp=c932cfef6a256467a06d2d470a9eb0a8624b6ff1;hpb=97b78b0003982c6374f4d631694ba2746580cf1f;p=distro-setup diff --git a/install-my-scripts b/install-my-scripts index c932cfe..dd52266 100755 --- a/install-my-scripts +++ b/install-my-scripts @@ -27,6 +27,18 @@ trap 'echo "$0:$LINENO:error: \"$BASH_COMMAND\" returned $?" >&2' ERR x="$(readlink -f -- "${BASH_SOURCE[0]}")"; cd ${x%/*} # directory of this file +m() { + "$@" +} + +# be a bit more verbose if we are connected to a terminal +if test -t 0; then + #echo debug: in terminal + m() { + echo "$*" + "$@" + } +fi # scripts that would interfere with unmounting /a, put them elsewhere. # note: previously used the install command, but it had this habit of @@ -36,7 +48,7 @@ x="$(readlink -f -- "${BASH_SOURCE[0]}")"; cd ${x%/*} # directory of this file # changed, so that should fix it. /a/bin/log-quiet/setup rsync -t --chmod=755 --chown=root:root switch-mail-host btrbk-run mount-latest-subvol \ - check-subvol-stale myi3status mailtest-check \ + check-subvol-stale myi3status \ mailbindwatchdog \ check-mailq \ unsaved-buffers.el \ @@ -52,6 +64,7 @@ cmd=( rsync -aiSAX --chown=root:root --chmod=g-s epanic-clean system-status btrfsmaint + mailtest-check dynamic-ip-update /usr/local/bin ) @@ -60,19 +73,24 @@ sre() { if [[ $(systemctl is-active $1.service ||:) != inactive ]]; then # just fire and forget. sometimes a script restart can fail, but then # then auto restart mechanism makes it succeed. - systemctl restart $service ||: & + m systemctl restart $service ||: & fi } while read -r line; do file="${line:12}" + #echo debug: file: $file case $file in btrfsmaint) - sre btrfsmaintstop & + sre btrfsmaintstop + ;; + mailtest-check) + # we stopped removing the dashes in services recently. + sre $file ;; *) - sre ${file//-/} & + sre ${file//-/} ;; esac done < <("${cmd[@]}")