fg &>/dev/null ||:
}
-sm() {
+sm() { # switch mail host
local tmp keyhash
c /
# run latest
s jrun switch-mail-host "$@"
return $ret
}
+sh2() { # switch host2
+ local tmp keyhash
+ c /
+ # run latest
+ keyhash=$(s ssh-keygen -lf /root/.ssh/home | awk '{print $2}')
+ tmp=$(s ssh-add -l | awk '$2 == "'$keyhash'"')
+ if [[ ! $tmp ]]; then
+ s ssh-add /root/.ssh/home
+ fi
+ install-my-scripts
+ s jrun switch-host2 "$@"
+ return $ret
+}
# shellcheck disable=SC2120
lipush() {
usage() {
cat <<EOF
-Usage: ${0##*/} [OPTIONS] push|pull HOST
+Usage: switch-mail-host|switch-host2 [OPTIONS] push|pull HOST
Turn off mail receiving on OLD_HOST, run btrbk to move mail to NEW_HOST,
turn on mail receiving on NEW_HOST. Assumes we want to move all