diff --git a/scripts/install_dwc2.sh b/scripts/install_dwc2.sh index 3ba1ef2..17e299d 100755 --- a/scripts/install_dwc2.sh +++ b/scripts/install_dwc2.sh @@ -319,18 +319,12 @@ dwc2_reverse_proxy_dialog(){ dwc2_port_check(){ if [ "$DWC2_ENABLED" = "false" ]; then if [ "$SITE_ENABLED" = "true" ]; then - echo "Detected other enabled Interfaces:" - [ "$OCTOPRINT_ENABLED" = "true" ] && echo "${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}" - [ "$MAINSAIL_ENABLED" = "true" ] && echo "${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}" - [ "$FLUIDD_ENABLED" = "true" ] && echo "${cyan}● Fluidd - Port:$FLUIDD_PORT${default}" + status_msg "Detected other enabled interfaces:" + [ "$OCTOPRINT_ENABLED" = "true" ] && echo " ${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}" + [ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}" + [ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}" if [ "$MAINSAIL_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then PORT_80_BLOCKED="true" - fi - if [ "$PORT_80_BLOCKED" = "true" ]; then - [ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!" - [ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!" - [ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!" - echo "You need to choose a different Port for DWC2 than the above!" select_dwc2_port fi else @@ -344,14 +338,32 @@ dwc2_port_check(){ } select_dwc2_port(){ - while true; do - read -p "${cyan}Please enter a new Port:${default} " NEW_PORT - if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ]; then - echo "Setting port $NEW_PORT for DWC2!" - SET_LISTEN_PORT=$NEW_PORT - break - else - echo "That port is already taken! Select a different one!" - fi - done + if [ "$PORT_80_BLOCKED" = "true" ]; then + echo + top_border + echo -e "| ${red}!!!WARNING!!!${default} |" + echo -e "| ${red}You need to choose a different port for DWC2!${default} |" + echo -e "| ${red}The following web interface is listening at port 80:${default} |" + blank_line + [ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |" + [ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |" + [ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |" + blank_line + echo -e "| Make sure you don't choose a port which was already |" + echo -e "| assigned to one of the other web interfaces! |" + blank_line + echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |" + echo -e "| input. So make sure to choose a valid port! |" + bottom_border + while true; do + read -p "${cyan}Please enter a new Port:${default} " NEW_PORT + if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then + echo "Setting port $NEW_PORT for DWC2!" + SET_LISTEN_PORT=$NEW_PORT + break + else + echo "That port is already taken! Select a different one!" + fi + done + fi } \ No newline at end of file diff --git a/scripts/install_fluidd.sh b/scripts/install_fluidd.sh index a7cd0c4..5df8e08 100755 --- a/scripts/install_fluidd.sh +++ b/scripts/install_fluidd.sh @@ -14,18 +14,12 @@ install_fluidd(){ fluidd_port_check(){ if [ "$FLUIDD_ENABLED" = "false" ]; then if [ "$SITE_ENABLED" = "true" ]; then - echo "Detected other enabled Interfaces:" - [ "$MAINSAIL_ENABLED" = "true" ] && echo "${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}" - [ "$DWC2_ENABLED" = "true" ] && echo "${cyan}● DWC2 - Port:$DWC2_PORT${default}" - [ "$OCTOPRINT_ENABLED" = "true" ] && echo "${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}" + status_msg "Detected other enabled interfaces:" + [ "$OCTOPRINT_ENABLED" = "true" ] && echo " ${cyan}● OctoPrint - Port: $OCTOPRINT_PORT${default}" + [ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port: $MAINSAIL_PORT${default}" + [ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port: $DWC2_PORT${default}" if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then PORT_80_BLOCKED="true" - fi - if [ "$PORT_80_BLOCKED" = "true" ]; then - [ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!" - [ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!" - [ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!" - echo "You need to choose a different Port for Fluidd than the above!" select_fluidd_port fi else @@ -39,16 +33,34 @@ fluidd_port_check(){ } select_fluidd_port(){ - while true; do - read -p "${cyan}Please enter a new Port:${default} " NEW_PORT - if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then - echo "Setting port $NEW_PORT for Mainsail!" - SET_LISTEN_PORT=$NEW_PORT - break - else - echo "That port is already taken! Select a different one!" - fi - done + if [ "$PORT_80_BLOCKED" = "true" ]; then + echo + top_border + echo -e "| ${red}!!!WARNING!!!${default} |" + echo -e "| ${red}You need to choose a different port for Fluidd!${default} |" + echo -e "| ${red}The following web interface is listening at port 80:${default} |" + blank_line + [ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |" + [ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |" + [ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |" + blank_line + echo -e "| Make sure you don't choose a port which was already |" + echo -e "| assigned to one of the other web interfaces! |" + blank_line + echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |" + echo -e "| input. So make sure to choose a valid port! |" + bottom_border + while true; do + read -p "${cyan}Please enter a new Port:${default} " NEW_PORT + if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then + echo "Setting port $NEW_PORT for Fluidd!" + SET_LISTEN_PORT=$NEW_PORT + break + else + echo "That port is already taken! Select a different one!" + fi + done + fi } get_fluidd_ver(){ diff --git a/scripts/install_mainsail.sh b/scripts/install_mainsail.sh index ae0a01a..a65ba1e 100755 --- a/scripts/install_mainsail.sh +++ b/scripts/install_mainsail.sh @@ -14,18 +14,12 @@ install_mainsail(){ mainsail_port_check(){ if [ "$MAINSAIL_ENABLED" = "false" ]; then if [ "$SITE_ENABLED" = "true" ]; then - echo "Detected other enabled Interfaces:" - [ "$FLUIDD_ENABLED" = "true" ] && echo "${cyan}● Fluidd - Port:$FLUIDD_PORT${default}" - [ "$DWC2_ENABLED" = "true" ] && echo "${cyan}● DWC2 - Port:$DWC2_PORT${default}" - [ "$OCTOPRINT_ENABLED" = "true" ] && echo "${cyan}● OctoPrint - Port:$OCTOPRINT_PORT${default}" + status_msg "Detected other enabled interfaces:" + [ "$OCTOPRINT_ENABLED" = "true" ] && echo -e " ${cyan}● OctoPrint - Port: $OCTOPRINT_PORT${default}" + [ "$FLUIDD_ENABLED" = "true" ] && echo -e " ${cyan}● Fluidd - Port: $FLUIDD_PORT${default}" + [ "$DWC2_ENABLED" = "true" ] && echo -e " ${cyan}● DWC2 - Port: $DWC2_PORT${default}" if [ "$FLUIDD_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$OCTOPRINT_PORT" = "80" ]; then PORT_80_BLOCKED="true" - fi - if [ "$PORT_80_BLOCKED" = "true" ]; then - [ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!" - [ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!" - [ "$OCTOPRINT_PORT" = "80" ] && echo "${cyan}OctoPrint${default} already listens on Port 80!" - echo "You need to choose a different Port for Mainsail than the above!" select_mainsail_port fi else @@ -39,16 +33,34 @@ mainsail_port_check(){ } select_mainsail_port(){ - while true; do - read -p "${cyan}Please enter a new Port:${default} " NEW_PORT - if [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then - echo "Setting port $NEW_PORT for Mainsail!" - SET_LISTEN_PORT=$NEW_PORT - break - else - echo "That port is already taken! Select a different one!" - fi - done + if [ "$PORT_80_BLOCKED" = "true" ]; then + echo + top_border + echo -e "| ${red}!!!WARNING!!!${default} |" + echo -e "| ${red}You need to choose a different port for Mainsail!${default} |" + echo -e "| ${red}The following web interface is listening at port 80:${default} |" + blank_line + [ "$OCTOPRINT_PORT" = "80" ] && echo "| ● OctoPrint |" + [ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |" + [ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |" + blank_line + echo -e "| Make sure you don't choose a port which was already |" + echo -e "| assigned to one of the other web interfaces! |" + blank_line + echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |" + echo -e "| input. So make sure to choose a valid port! |" + bottom_border + while true; do + read -p "${cyan}Please enter a new Port:${default} " NEW_PORT + if [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$OCTOPRINT_PORT" ]; then + echo "Setting port $NEW_PORT for Mainsail!" + SET_LISTEN_PORT=$NEW_PORT + break + else + echo "That port is already taken! Select a different one!" + fi + done + fi } get_mainsail_ver(){ diff --git a/scripts/install_octoprint.sh b/scripts/install_octoprint.sh index 90e956d..273a129 100755 --- a/scripts/install_octoprint.sh +++ b/scripts/install_octoprint.sh @@ -142,18 +142,12 @@ octoprint_reverse_proxy_dialog(){ octoprint_port_check(){ if [ "$OCTOPRINT_ENABLED" = "false" ]; then if [ "$SITE_ENABLED" = "true" ]; then - echo "Detected other enabled Interfaces:" - [ "$MAINSAIL_ENABLED" = "true" ] && echo "${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}" - [ "$FLUIDD_ENABLED" = "true" ] && echo "${cyan}● Fluidd - Port:$FLUIDD_PORT${default}" - [ "$DWC2_ENABLED" = "true" ] && echo "${cyan}● DWC2 - Port:$DWC2_PORT${default}" + status_msg "Detected other enabled interfaces:" + [ "$MAINSAIL_ENABLED" = "true" ] && echo " ${cyan}● Mainsail - Port:$MAINSAIL_PORT${default}" + [ "$FLUIDD_ENABLED" = "true" ] && echo " ${cyan}● Fluidd - Port:$FLUIDD_PORT${default}" + [ "$DWC2_ENABLED" = "true" ] && echo " ${cyan}● DWC2 - Port:$DWC2_PORT${default}" if [ "$MAINSAIL_PORT" = "80" ] || [ "$DWC2_PORT" = "80" ] || [ "$FLUIDD_PORT" = "80" ]; then PORT_80_BLOCKED="true" - fi - if [ "$PORT_80_BLOCKED" = "true" ]; then - [ "$MAINSAIL_PORT" = "80" ] && echo "${cyan}Mainsail${default} already listens on Port 80!" - [ "$FLUIDD_PORT" = "80" ] && echo "${cyan}Fluidd${default} already listens on Port 80!" - [ "$DWC2_PORT" = "80" ] && echo "${cyan}DWC2${default} already listens on Port 80!" - echo "You need to choose a different Port for OctoPrint than the above!" select_octoprint_port fi else @@ -167,16 +161,34 @@ octoprint_port_check(){ } select_octoprint_port(){ - while true; do - read -p "${cyan}Please enter a new Port:${default} " NEW_PORT - if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ]; then - echo "Setting port $NEW_PORT for OctoPrint!" - SET_LISTEN_PORT=$NEW_PORT - break - else - echo "That port is already taken! Select a different one!" - fi - done + if [ "$PORT_80_BLOCKED" = "true" ]; then + echo + top_border + echo -e "| ${red}!!!WARNING!!!${default} |" + echo -e "| ${red}You need to choose a different port for OctoPrint!${default} |" + echo -e "| ${red}The following web interface is listening at port 80:${default} |" + blank_line + [ "$MAINSAIL_PORT" = "80" ] && echo "| ● Mainsail |" + [ "$FLUIDD_PORT" = "80" ] && echo "| ● Fluidd |" + [ "$DWC2_PORT" = "80" ] && echo "| ● DWC2 |" + blank_line + echo -e "| Make sure you don't choose a port which was already |" + echo -e "| assigned to one of the other web interfaces! |" + blank_line + echo -e "| Be aware: there is ${red}NO${default} sanity check for the following |" + echo -e "| input. So make sure to choose a valid port! |" + bottom_border + while true; do + read -p "${cyan}Please enter a new Port:${default} " NEW_PORT + if [ "$NEW_PORT" != "$MAINSAIL_PORT" ] && [ "$NEW_PORT" != "$FLUIDD_PORT" ] && [ "$NEW_PORT" != "$DWC2_PORT" ]; then + echo "Setting port $NEW_PORT for OctoPrint!" + SET_LISTEN_PORT=$NEW_PORT + break + else + echo "That port is already taken! Select a different one!" + fi + done + fi } create_config_yaml(){