Update debian-installer.sh

This commit is contained in:
2025-09-19 11:24:34 +02:00
parent 25cc17e98d
commit a1291dd16b

View File

@@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
INSTALLERVERSION="1.05.01" INSTALLERVERSION="1.05.02"
## THE HTTP AND HTTPS TESTS ARE DISABLED IN THIS VERSION UNTIL WE HAVE FINISHED MIGRATING THE API TO A NEW SERVER...
if [[ $(whoami) != "root" ]]; then if [[ $(whoami) != "root" ]]; then
echo "You must be root to run this script!" echo "You must be root to run this script!"
@@ -1176,18 +1178,19 @@ if [[ $p -lt 4 ]]; then
fi fi
if [[ $p -lt 5 ]]; then if [[ $p -lt 5 ]]; then
decho "[Step $((p+1))] Testing that Apache2 is accessible from the web... [Current Runtime: $(showTimer $SECONDS)]" decho "[Step $((p+1))] Skipping HTTP and HTTPS test until the API has been moved to a new server and fully tested... [Current Runtime: $(showTimer $SECONDS)]"
a2enmod ssl > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl restart apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to enable module ssl..." #decho "[Step $((p+1))] Testing that Apache2 is accessible from the web... [Current Runtime: $(showTimer $SECONDS)]"
a2ensite default-ssl.conf > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl reload apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to activate default SSL configuration..." #a2enmod ssl > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl restart apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to enable module ssl..."
json=$(curl -s "http://api.zaks.web.za/testhttp") #a2ensite default-ssl.conf > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl reload apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to activate default SSL configuration..."
httpresult=$(echo "$json" | jq -r .http.result) #json=$(curl -s "http://api.zaks.web.za/testhttp")
httpsresult=$(echo "$json" | jq -r .https.result) #httpresult=$(echo "$json" | jq -r .http.result)
if [[ "$httpresult" != "OK" ]] || [[ "$httpsresult" != "OK" ]]; then #httpsresult=$(echo "$json" | jq -r .https.result)
failMsg "HTTP=$httpresult HTTPS=$httpsresult" #if [[ "$httpresult" != "OK" ]] || [[ "$httpsresult" != "OK" ]]; then
fi # failMsg "HTTP=$httpresult HTTPS=$httpsresult"
echo "HTTP $httpresult" #fi
echo "HTTPS $httpsresult" #echo "HTTP $httpresult"
a2dissite default-ssl.conf > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl reload apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to deactivate default SSL configuration... [Current Runtime: $(showTimer $SECONDS)]" #echo "HTTPS $httpsresult"
#a2dissite default-ssl.conf > /dev/null 2>> "$oldpath/installer-errors.log" && systemctl reload apache2 > /dev/null 2>> "$oldpath/installer-errors.log" || failMsg "Apache2 failed to deactivate default SSL configuration... [Current Runtime: $(showTimer $SECONDS)]"
((p++)) ((p++))
echo "$p" > position.temp echo "$p" > position.temp
fi fi
@@ -1200,17 +1203,18 @@ if [[ $p -lt 6 ]]; then
fi fi
if [[ $p -lt 7 ]]; then if [[ $p -lt 7 ]]; then
decho "[Step $((p+1))] Testing your domain $FQDN resolves to your server... [Current Runtime: $(showTimer $SECONDS)]" decho "[Step $((p+1))] Skipping FQDN Resolution test until the API has been moved to a new server and fully tested... [Current Runtime: $(showTimer $SECONDS)]"
json=$(curl -s "http://api.zaks.web.za/testhttp?address=$FQDN&https=false") #decho "[Step $((p+1))] Testing your domain $FQDN resolves to your server... [Current Runtime: $(showTimer $SECONDS)]"
if [[ "$(echo "$json" | jq -r .status)" == "400" ]]; then #json=$(curl -s "http://api.zaks.web.za/testhttp?address=$FQDN&https=false")
failMsg "$(echo "$json" | jq -r .data)" #if [[ "$(echo "$json" | jq -r .status)" == "400" ]]; then
fi # failMsg "$(echo "$json" | jq -r .data)"
httpresult=$(echo "$json" | jq -r .http.result) #fi
httpmessage=$(echo "$json" | jq -r .http.message) #httpresult=$(echo "$json" | jq -r .http.result)
if [[ "$httpresult" != "OK" ]]; then #httpmessage=$(echo "$json" | jq -r .http.message)
failMsg "$httpmessage" #if [[ "$httpresult" != "OK" ]]; then
fi # failMsg "$httpmessage"
echo "HTTP $httpresult" #fi
#echo "HTTP $httpresult"
((p++)) ((p++))
echo "$p" > position.temp echo "$p" > position.temp
fi fi