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
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
echo "You must be root to run this script!"
@@ -1176,18 +1178,19 @@ if [[ $p -lt 4 ]]; then
fi
if [[ $p -lt 5 ]]; then
decho "[Step $((p+1))] Testing that Apache2 is accessible from the web... [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..."
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..."
json=$(curl -s "http://api.zaks.web.za/testhttp")
httpresult=$(echo "$json" | jq -r .http.result)
httpsresult=$(echo "$json" | jq -r .https.result)
if [[ "$httpresult" != "OK" ]] || [[ "$httpsresult" != "OK" ]]; then
failMsg "HTTP=$httpresult HTTPS=$httpsresult"
fi
echo "HTTP $httpresult"
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)]"
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)]"
#decho "[Step $((p+1))] Testing that Apache2 is accessible from the web... [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..."
#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..."
#json=$(curl -s "http://api.zaks.web.za/testhttp")
#httpresult=$(echo "$json" | jq -r .http.result)
#httpsresult=$(echo "$json" | jq -r .https.result)
#if [[ "$httpresult" != "OK" ]] || [[ "$httpsresult" != "OK" ]]; then
# failMsg "HTTP=$httpresult HTTPS=$httpsresult"
#fi
#echo "HTTP $httpresult"
#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++))
echo "$p" > position.temp
fi
@@ -1200,17 +1203,18 @@ if [[ $p -lt 6 ]]; then
fi
if [[ $p -lt 7 ]]; then
decho "[Step $((p+1))] Testing your domain $FQDN resolves to your server... [Current Runtime: $(showTimer $SECONDS)]"
json=$(curl -s "http://api.zaks.web.za/testhttp?address=$FQDN&https=false")
if [[ "$(echo "$json" | jq -r .status)" == "400" ]]; then
failMsg "$(echo "$json" | jq -r .data)"
fi
httpresult=$(echo "$json" | jq -r .http.result)
httpmessage=$(echo "$json" | jq -r .http.message)
if [[ "$httpresult" != "OK" ]]; then
failMsg "$httpmessage"
fi
echo "HTTP $httpresult"
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)]"
#decho "[Step $((p+1))] Testing your domain $FQDN resolves to your server... [Current Runtime: $(showTimer $SECONDS)]"
#json=$(curl -s "http://api.zaks.web.za/testhttp?address=$FQDN&https=false")
#if [[ "$(echo "$json" | jq -r .status)" == "400" ]]; then
# failMsg "$(echo "$json" | jq -r .data)"
#fi
#httpresult=$(echo "$json" | jq -r .http.result)
#httpmessage=$(echo "$json" | jq -r .http.message)
#if [[ "$httpresult" != "OK" ]]; then
# failMsg "$httpmessage"
#fi
#echo "HTTP $httpresult"
((p++))
echo "$p" > position.temp
fi