Merge pull request 'Direct to CDN test is successful' (#1) from direct-cdn into main

Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
2026-01-31 22:06:00 -05:00

View File

@@ -9,9 +9,6 @@ PC=$(uname -n | awk '{print $1}')
guardband() { guardband() {
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "${CY}Cleaning up temp directory for checksums...${NF}"
rm -rf /.SSH/.temp
sleep 2
echo -e "${CR}Script Exited with an Error.${NF}" echo -e "${CR}Script Exited with an Error.${NF}"
exit 1 exit 1
fi fi
@@ -26,29 +23,13 @@ if ! wget --spider "$CDN" 2>/dev/null; then
return 1 return 1
else else
echo -e "${CG}CDN available for checksum downloads - ${FB}Proceeding...${NF}" echo -e "${CG}CDN available for checksum downloads - ${FB}Proceeding...${NF}"
serversidePUB=$(wget https://cdn.franscorack.com/chksum/sshprov/pub -q -O -)
serversidePRIV=$(wget https://cdn.franscorack.com/chksum/sshprov/priv -q -O -)
sleep 2 sleep 2
fi fi
} }
downloadpub(){
wget -q https://cdn.franscorack.com/chksum/sshprov/pub -O /.SSH/.temp/pub
if [ $? -ne 0 ]; then
echo -e "${CR}Download error: CDN reported error in file download${NF}"
return 1
fi
}
downloadpriv(){
wget -q https://cdn.franscorack.com/chksum/sshprov/priv -O /.SSH/.temp/priv
if [ $? -ne 0 ]; then
echo -e "${CR}Download error: CDN reported error in file download${NF}"
return 1
fi
}
rootcheck(){ rootcheck(){
serversidePRIV=$(cat /.SSH/.temp/priv | awk '{print $1}')
serversidePUB=$(cat /.SSH/.temp/pub | awk '{print $1}')
if [ -f /root/.ssh/id_ed25519 ]; then if [ -f /root/.ssh/id_ed25519 ]; then
rootPRIV=$(sha256sum /root/.ssh/id_ed25519 | awk '{print $1}') rootPRIV=$(sha256sum /root/.ssh/id_ed25519 | awk '{print $1}')
else else
@@ -198,8 +179,12 @@ if [ "$UID" -ne 0 ]; then
fi fi
echo -e ${CY}Warning: running this script resets known_hosts file. Abort this script using CTRL+C if you want to avoid that.${NF} echo -e ${CY}Warning: running this script resets known_hosts file. Abort this script using CTRL+C if you want to avoid that.${NF}
sleep 3 sleep 3
if [ -f /home/$USER/.ssh/known_hosts ]; then
rm /home/$USER/.ssh/known_hosts rm /home/$USER/.ssh/known_hosts
fi
if [ -f /root/.ssh/known_hosts ]; then
rm /root/.ssh/known_hosts rm /root/.ssh/known_hosts
fi
if [ ! -f ".SSH/.temp" ]; then if [ ! -f ".SSH/.temp" ]; then
mkdir /.SSH/.temp mkdir /.SSH/.temp
fi fi
@@ -207,19 +192,11 @@ if [ "$PC" = "pve01" ]
then then
verifycdn verifycdn
guardband guardband
downloadpub
guardband
downloadpriv
guardband
rootcheck rootcheck
guardband guardband
else else
verifycdn verifycdn
guardband guardband
downloadpub
guardband
downloadpriv
guardband
rootcheck rootcheck
guardband guardband
admincheck admincheck