Hide output. Improve the error messages.
This commit is contained in:
+2
-2
@@ -101,7 +101,7 @@ setup_ssh() {
|
||||
|
||||
echod "\n ➡️ Copying SSH key to target host '${TARGET_USER}@${LIVE_TARGET_IP}'..."
|
||||
|
||||
if cat "/home/${USER}/.ssh/known_hosts" | grep "${LIVE_TARGET_IP}"; then
|
||||
if cat "/home/${USER}/.ssh/known_hosts" | grep "${LIVE_TARGET_IP}" >> "${STDOUT}" 2>> "${STDERR}"; then
|
||||
echo -e "\n ⚠️ The SSH fingerprint for the selected IP address $(gum style --italic "\"${LIVE_TARGET_IP}\"") is not the same as the one in $(gum style --italic "\".ssh/known_hosts\"").
|
||||
|
||||
This could occur for multiple reasons :
|
||||
@@ -113,7 +113,7 @@ setup_ssh() {
|
||||
The script $(gum style --bold "cannot continue") without the correct fingerprint installed.
|
||||
If you are unsure, it is always better to check manually.\n"
|
||||
|
||||
gum confirm "Remove the old fingerprint and accept the new one ?" || { echo -e "\n\n ❌ Exiting."; exit 22; }
|
||||
gum confirm "Remove the old fingerprint and accept the new one ?" || { echo -e "\n\n ❌ SSH fingerprints don't match."; exit 22; }
|
||||
sed -i '/${LIVE_TARGET_IP}/d' "~/.ssh/known_hosts"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user