fix: tweak moonraker/mainsail install process

This commit is contained in:
th33xitus
2020-09-11 11:31:53 +02:00
parent fa669a8690
commit 1ec269969b
3 changed files with 33 additions and 20 deletions

View File

@@ -9,12 +9,13 @@ install_mainsail(){
}
test_nginx(){
HOST_IP=$(hostname -I | cut -d" " -f1)
status_msg "Testing Nginx ..."
sleep 5
status_msg "API response from http://localhost/printer/info :"
API_RESPONSE="$(curl -sG4m5 http://localhost/printer/info)"
status_msg "API response from http://$HOST_IP/printer/info :"
API_RESPONSE="$(curl -sG4m5 http://$HOST_IP/printer/info)"
echo -e "${cyan}$API_RESPONSE${default}"
if [ $(curl -sG4 "http://localhost/printer/info" | grep '^{"result"' -c) -eq 1 ]; then
if [ $(curl -sG4 "http://$HOST_IP/printer/info" | grep '^{"result"' -c) -eq 1 ]; then
echo; ok_msg "Nginx is working correctly!"; echo
else
echo; warn_msg "Nginx is not working correctly!"; echo