|
|
@ -44,22 +44,6 @@ function install_fake_additional { |
|
|
echo 'install fake additional...' |
|
|
echo 'install fake additional...' |
|
|
miaou-push $CONTAINER $HOME/.ssh/id_ed25519 /root/.ssh/ |
|
|
miaou-push $CONTAINER $HOME/.ssh/id_ed25519 /root/.ssh/ |
|
|
miaou-push $CONTAINER $HOME/.ssh/id_ed25519.pub /root/.ssh/ |
|
|
miaou-push $CONTAINER $HOME/.ssh/id_ed25519.pub /root/.ssh/ |
|
|
|
|
|
|
|
|
local sympa_domain=$(miaou-exec $CONTAINER -- grep ^domain /etc/sympa/sympa/sympa.conf | cut -f2) |
|
|
|
|
|
echo sympa_domain=$sympa_domain |
|
|
|
|
|
local sympa_authenticity_key_host=$(ssh-keygen -lF $sympa_domain | grep "^$sympa_domain ED25519" | head -1) |
|
|
|
|
|
[[ -z $sympa_authenticity_key_host ]] && |
|
|
|
|
|
echo "fake additional has failed due to unknown machine: $sympa_domain. please connect once like: \`ssh $sympa_domain\` then retry" && |
|
|
|
|
|
exit 11 |
|
|
|
|
|
|
|
|
|
|
|
miaou-exec $CONTAINER -- bash <<EOF |
|
|
|
|
|
ssh-keyscan -t ed25519 -H $sympa_domain >> /root/.ssh/known_hosts |
|
|
|
|
|
EOF |
|
|
|
|
|
local sympa_authenticity_key_container=$(miaou-exec $CONTAINER -- ssh-keygen -lF $sympa_domain | grep "^$sympa_domain ED25519" | head -1) |
|
|
|
|
|
[[ "$sympa_authenticity_key_host" != "$sympa_authenticity_key_container" ]] && |
|
|
|
|
|
echo "authenticity key for machine: $sympa_domain mismatched!. please compare like: \`ssh-keygen -lF $sympa_domain\` both from host and container" && |
|
|
|
|
|
exit 12 |
|
|
|
|
|
|
|
|
|
|
|
miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_ldap_auth_remote.recipe |
|
|
miaou-recipe "$CONTAINER" "$BASEDIR"/../recipe/sympa_ldap_auth_remote.recipe |
|
|
echo 'install fake additional...OK' |
|
|
echo 'install fake additional...OK' |
|
|
} |
|
|
} |
|
|
|