This commit is contained in:
accel 2022-01-11 21:22:39 +03:00
parent e994994c38
commit 1a05895f73

View File

@ -113,10 +113,10 @@ function zssh_check_pubkeys()
function zssh_install_peers()
{
[[ -n $zssh_host ]] || return 63
zshlibs_log zssh "installing peers"
zshlibs_log zssh_client "installing peers"
for ssh_node in $zssh_nodes
do
zshlibs_log zssh "installing peer $ssh_node"
zshlibs_log zssh_client "installing peer $ssh_node"
zssh_generate_privkey4 $ssh_node
zssh_generate_config4 $ssh_node
done
@ -204,15 +204,15 @@ function zssh_generate_config4
function zssh_generate_privkey4
{
ssh_node="$1"
zshlibs_log zssh "checking keys for peer $ssh_node"
zshlibs_log zssh_client "checking keys for peer $ssh_node"
local newkey=$zssh_private_keys/$ssh_node.key
if ! [[ -s $newkey ]]
then
zshlibs_log zssh "generate key for $ssh_node"
zshlibs_log zssh_client "generate key for $ssh_node"
ssh-keygen -t ed25519 -N '' -C "$ssh_host($USER@$HOST) for $ssh_node" -f $newkey >> "${HOME}/.log/ssh-keygen.log"
if [[ "$ssh_node" == "$zssh_host" ]]
then
zshlibs_log zssh "Self accepting key: $ssh_node"
zshlibs_log zssh_client "Self accepting key: $ssh_node"
cat "$newkey.pub" >> ${HOME}/.ssh/authorized_keys
fi
fi
@ -222,7 +222,7 @@ function zssh_generate_privkey4
function zssh_enumeratenodes()
{
typeset -g -a zssh_nodes;
zshlibs_log zssh "enumerating nodes"
zshlibs_log zssh_configure "enumerating nodes"
if [[ -d $zssh_global_configs ]]
then
for __ssh_node in ${zssh_global_configs}/*(/)
@ -230,5 +230,5 @@ function zssh_enumeratenodes()
zssh_nodes+=($(basename $__ssh_node))
done
fi
zshlibs_log zssh "got ${#zssh_nodes} nodes"
zshlibs_log zssh_configure "got ${#zssh_nodes} nodes"
}