X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=switch-mail-host;h=9315807d6ca00196574a06d967158c951f7becfc;hb=3f437c0f6c11356451d5d739875eee2d4603d7ca;hp=ab57c13c012fd3a6a1850180ac6f4ff0fc48eb46;hpb=3a5055dce8796a1946d9f75d8c74605eb73d19df;p=distro-setup diff --git a/switch-mail-host b/switch-mail-host index ab57c13..9315807 100755 --- a/switch-mail-host +++ b/switch-mail-host @@ -22,7 +22,6 @@ EOF ##### begin command line parsing ######## update_wrt=true # default -long_opt=foo # default temp=$(getopt -l help wh "$@") || usage 1 eval set -- "$temp" while true; do @@ -121,6 +120,15 @@ if $old_shell systemctl is-active btrbk.timer; then restore_old_btrbk=true fi +for ((i=0; i<10; i++)); do + $old_shell killall arbtt-capture || break + sleep 1 + if [[ i == 9 ]]; then + warn="WARNING!!! failed to kill arbtt-capture" + fi + done + + $new_shell bash -s <<'EOF' set -eE if mountpoint /m; then sudo umount /m; fi @@ -148,7 +156,7 @@ mail-setup() { mail-setup "$old_shell" sudo dd of=/etc/btrbk.conf <<'EOF' -ssh_identity /root/.ssh/id_rsa +ssh_identity /root/.ssh/home # Just a guess that local7 is a good facility to pick. # It's a bit odd that the transaction log has to be logged to # a file or syslog, while other output is sent to std out. @@ -198,10 +206,10 @@ target send-receive $btrbk_dst EOF -sudo btrbk --progress run +sudo btrbk -l debug --progress run $new_shell mount-latest-subvol -mail-setup +mail-setup "$new_shell" if $restore_new_btrbk; then $new_shell sudo systemctl start btrbk.timer @@ -209,3 +217,7 @@ fi if $restore_old_btrbk; then $old_shell sudo systemctl start btrbk.timer fi + +$new_shell arbtt-capture --sample-rate=10 & + +echo $warn