From: Ian Kelling Date: Thu, 1 Sep 2022 16:37:47 +0000 (-0400) Subject: add switch-host2 X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=fefb2a411185c293de6bb6aa8aec698a80db3659 add switch-host2 --- diff --git a/brc2 b/brc2 index 4877c3f..b97d067 100644 --- a/brc2 +++ b/brc2 @@ -504,7 +504,7 @@ srun() { fg &>/dev/null ||: } -sm() { +sm() { # switch mail host local tmp keyhash c / # run latest @@ -517,6 +517,19 @@ sm() { 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() { diff --git a/switch-host2 b/switch-host2 new file mode 120000 index 0000000..a9df53c --- /dev/null +++ b/switch-host2 @@ -0,0 +1 @@ +switch-mail-host \ No newline at end of file diff --git a/switch-mail-host b/switch-mail-host index fd3d032..09bd739 100644 --- a/switch-mail-host +++ b/switch-mail-host @@ -4,7 +4,7 @@ source /usr/local/lib/err usage() { cat <