From 7e7043ad489b6ae2072f4e0deee8681a2b5b1a71 Mon Sep 17 00:00:00 2001 From: Mitsunori YOSHIDA Date: Sun, 4 Jun 2023 00:45:47 +0000 Subject: [PATCH 1/2] enable to install mainsail/fluidd without moonraker This allows the user to install remote mode Mainsail / Fluidd without Moonraker installed in order to setup separated web server from klipper host. --- scripts/fluidd.sh | 16 +++++++++++++++- scripts/mainsail.sh | 22 +++++++++++++++++++--- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 42fda1d..2778d67 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -19,7 +19,21 @@ function install_fluidd() { ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then local error="Moonraker not installed! Please install Moonraker first!" - print_error "${error}" && return + print_error "${error}" + while true; do + read -p "${cyan}###### Install Fluidd without Moonraker? (y/N):${white} " yn + case "${yn}" in + Y|y|Yes|yes) + select_msg "Yes" + break;; + N|n|No|no|"") + select_msg "No" + abort_msg "Exiting Fluidd setup ...\n" + return;; + *) + error_msg "Invalid Input!";; + esac + done fi ### checking dependencies diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index 0cdedfd..b5245a9 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -19,7 +19,21 @@ function install_mainsail() { ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then local error="Moonraker not installed! Please install Moonraker first!" - print_error "${error}" && return + print_error "${error}" + while true; do + read -p "${cyan}###### Install remote-mode Mainsail without Moonraker? (y/N):${white} " yn + case "${yn}" in + Y|y|Yes|yes) + select_msg "Yes" + break;; + N|n|No|no|"") + select_msg "No" + abort_msg "Exiting Mainsail setup ...\n" + return;; + *) + error_msg "Invalid Input!";; + esac + done fi ### checking dependencies @@ -157,6 +171,7 @@ function download_mainsail_macros() { } function download_mainsail() { + local services local url url=$(get_mainsail_download_url) @@ -179,8 +194,9 @@ function download_mainsail() { exit 1 fi - ### check for moonraker multi-instance and if multi-instance was found, enable mainsails remoteMode - if [[ $(moonraker_systemd | wc -w) -gt 1 ]]; then + ### check for moonraker multi-instance and if no-instance or multi-instance was found, enable mainsails remoteMode + services=$(moonraker_systemd) + if [[ ( -z "$services" ) || ( $(echo "${services}" | wc -w) -gt 1 ) ]]; then enable_mainsail_remotemode fi } -- 2.39.5 From fd05e14a00be96bf235e0c9d6565540b25c838c5 Mon Sep 17 00:00:00 2001 From: th33xitus Date: Tue, 6 Jun 2023 21:08:40 +0200 Subject: [PATCH 2/2] style(mainsail/fluidd): fix wording Signed-off-by: Dominik Willner --- scripts/fluidd.sh | 8 ++++---- scripts/mainsail.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/fluidd.sh b/scripts/fluidd.sh index 2778d67..c3170c4 100644 --- a/scripts/fluidd.sh +++ b/scripts/fluidd.sh @@ -16,12 +16,12 @@ set -e #===================================================# function install_fluidd() { - ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then - local error="Moonraker not installed! Please install Moonraker first!" + local error="Moonraker not installed! It's recommended to install Moonraker first!" print_error "${error}" while true; do - read -p "${cyan}###### Install Fluidd without Moonraker? (y/N):${white} " yn + local yn + read -p "${cyan}###### Proceed to install Fluidd without installing Moonraker? (y/N):${white} " yn case "${yn}" in Y|y|Yes|yes) select_msg "Yes" @@ -44,7 +44,7 @@ function install_fluidd() { status_msg "Initializing Fluidd installation ..." ### first, we create a backup of the full klipper_config dir - safety first! - backup_klipper_config_dir + #backup_klipper_config_dir ### check for other enabled web interfaces unset SET_LISTEN_PORT diff --git a/scripts/mainsail.sh b/scripts/mainsail.sh index b5245a9..295fd49 100644 --- a/scripts/mainsail.sh +++ b/scripts/mainsail.sh @@ -16,12 +16,12 @@ set -e #===================================================# function install_mainsail() { - ### exit early if moonraker not found if [[ -z $(moonraker_systemd) ]]; then - local error="Moonraker not installed! Please install Moonraker first!" + local error="Moonraker not installed! It's recommended to install Moonraker first!" print_error "${error}" while true; do - read -p "${cyan}###### Install remote-mode Mainsail without Moonraker? (y/N):${white} " yn + local yn + read -p "${cyan}###### Proceed to install Mainsail without installing Moonraker? (y/N):${white} " yn case "${yn}" in Y|y|Yes|yes) select_msg "Yes" @@ -196,7 +196,7 @@ function download_mainsail() { ### check for moonraker multi-instance and if no-instance or multi-instance was found, enable mainsails remoteMode services=$(moonraker_systemd) - if [[ ( -z "$services" ) || ( $(echo "${services}" | wc -w) -gt 1 ) ]]; then + if [[ ( -z "${services}" ) || ( $(echo "${services}" | wc -w) -gt 1 ) ]]; then enable_mainsail_remotemode fi } -- 2.39.5