audit echo vs log across all scripts — outcomes always visible, verbose for per-item loops

This commit is contained in:
Gmer4Lfe
2026-06-14 12:40:15 -04:00
parent 4c37ab16fd
commit 3964f6fb46
1010 changed files with 377767 additions and 132 deletions
+4 -4
View File
@@ -90,7 +90,7 @@ if [[ "$DIRECTION" == "h1" || "$DIRECTION" == "both" ]]; then
"sed -i \"|${KEY_BLOB}|d\" /root/.ssh/authorized_keys 2>/dev/null
sed -i \"/^${MIRROR_ID}_PHASE\|^${MIRROR_ID}_KEY_READY/d\" $(platform_setup_db_path) 2>/dev/null
echo ok" 2>/dev/null | grep -q ok && {
log "HOST1 key removed from $MIRROR authorized_keys ✅"
echo "HOST1 key removed from $MIRROR authorized_keys ✅"
H1_DONE=true
} || warn "Could not SSH to $MIRROR — remove HOST1 key there manually"
fi
@@ -102,7 +102,7 @@ if [[ "$DIRECTION" == "h1" || "$DIRECTION" == "both" ]]; then
elif [[ "$DRY_RUN" == true ]]; then
warn "DRY RUN — would delete: $SSH_KEY and ${SSH_KEY}.pub"
else
rm -f "$SSH_KEY" "$SSH_KEY_PUB" && log "Local key pair deleted ✅" || \
rm -f "$SSH_KEY" "$SSH_KEY_PUB" && echo "Local key pair deleted ✅" || \
warn "Failed to delete local key — check permissions"
fi
@@ -110,7 +110,7 @@ if [[ "$DIRECTION" == "h1" || "$DIRECTION" == "both" ]]; then
if [[ -f "$STATE_FILE" ]]; then
if [[ "$DRY_RUN" == false ]]; then
sed -i "/^${MIRROR_ID}_PHASE/d; /^${MIRROR_ID}_KEY_READY/d" "$STATE_FILE"
log "Phase flags cleared from local setup.db ✅"
echo "Phase flags cleared from local setup.db ✅"
else
warn "DRY RUN — would clear ${MIRROR_ID}_PHASE* from setup.db"
fi
@@ -133,7 +133,7 @@ if [[ "$DIRECTION" == "h2" || "$DIRECTION" == "both" ]]; then
H2_DONE=true
else
sed -i "/${MIRROR_SHORT}/Id" "$AUTH_KEYS" && {
log "$MIRROR key removed from HOST1 authorized_keys ✅"
echo "$MIRROR key removed from HOST1 authorized_keys ✅"
H2_DONE=true
} || warn "Failed to remove $MIRROR key from HOST1 authorized_keys"
fi