From b098163830441fa6c2d33d17d21ed132432cd704 Mon Sep 17 00:00:00 2001 From: Franscobec Date: Mon, 23 Feb 2026 19:41:03 -0500 Subject: [PATCH] Update renewkeys.sh --- renewkeys.sh | 56 ++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/renewkeys.sh b/renewkeys.sh index 9be3c87..233baaa 100644 --- a/renewkeys.sh +++ b/renewkeys.sh @@ -14,6 +14,17 @@ exit 1 fi } +cleanup() { +echo -e "${CR}Attention: Script in fix mode - This will reset the .ssh folder. Press CTRL+C ${FB}NOW${NF} ${CR}if you want to avoid this.${NF}" +sleep 5 +if [[ $1 = "--pve01" ]]; then +find /root/.ssh/ -type f -delete +else +find /root/.ssh/ -type f -delete +find /home/$USER/.ssh/ -type f -delete +fi +} + verifycdn(){ CDN="https://cdn.franscorack.com" echo -e "${CY}Verifying CDN availability...${NF}" @@ -185,19 +196,38 @@ fi if [ -f /root/.ssh/known_hosts ]; then rm /root/.ssh/known_hosts fi -if [ "$PC" = "pve01" ] -then -verifycdn -guardband -rootcheck -guardband -else -verifycdn -guardband -rootcheck -guardband -admincheck -guardband +if [[ $1 = "--fix" ]]; then + if [ "$PC" = "pve01" ] + then + cleanup --pve01 + verifycdn + guardband + rootcheck + guardband + else + cleanup + verifycdn + guardband + rootcheck + guardband + admincheck + guardband + fi + else + if [ "$PC" = "pve01" ] + then + verifycdn + guardband + rootcheck + guardband + else + verifycdn + guardband + rootcheck + guardband + admincheck + guardband + fi fi sleep 2 echo -e "${CG}Script execution completed.${NF}"