This commit is contained in:
Cyril 2024-03-23 14:53:32 +01:00
parent 6804b606d7
commit 7ee3504407
9 changed files with 128 additions and 0 deletions

91
scripts/guppyflo.sh Executable file
View file

@ -0,0 +1,91 @@
#!/bin/sh
set -e
function guppyflo_message(){
top_line
title 'GuppyFLO' "${yellow}"
inner_line
hr
echo -e "${cyan}GuppyFLO is a self-hosted service that enables local/remote ${white}"
echo -e "${cyan}management of multiple Klipper printers using Moonraker. ${white}"
hr
bottom_line
}
function install_guppyflo(){
guppyflo_message
local yn
while true; do
install_msg "GuppyFLO" yn
case "${yn}" in
Y|y)
echo -e "${white}"
if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
echo -e "Info: Stopping GuppyFLO service..."
/etc/init.d/S99guppyflo stop &> /dev/null
fi
if [ -d "$GUPPYFLO_FOLDER" ]; then
rm -rf "$GUPPYFLO_FOLDER"
fi
if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
rm -f "$INITD_FOLDER"/S99guppyflo
fi
if [ -f /lib/libeinfo.so.1 ]; then
rm -f /lib/libeinfo.so.1
fi
if [ -f /lib/librc.so.1 ]; then
rm -f /lib/librc.so.1
fi
echo -e "Info: Downloading GuppyFLO file..."
"$CURL" -L "$GUPPYFLO_URL" -o "$USR_DATA"/guppyflo.zip
echo -e "Info: Creating directory..."
mkdir -p "$GUPPYFLO_FOLDER"
echo -e "Info: Extracting files..."
unzip "$USR_DATA"/guppyflo.zip -d "$GUPPYFLO_FOLDER"
rm -f "$USR_DATA"/guppyflo.zip
echo -e "Info: Linking files..."
ln -sf "$GUPPYFLO_FOLDER"/services/S99guppyflo "$INITD_FOLDER"/S99guppyflo
ln -sf "$GUPPYFLO_FOLDER"/services/respawn/libeinfo.so.1 /lib/libeinfo.so.1
ln -sf "$GUPPYFLO_FOLDER"/services/respawn/librc.so.1 /lib/librc.so.1
echo -e "Info: Starting GuppyFLO service..."
/etc/init.d/S99guppyflo start &> /dev/null
ok_msg "GuppyFLO has been installed successfully!"
echo -e " You can now connect to GuppyFLO Web Interface with ${yellow}http://$(check_ipaddress):9873${white}"
return;;
N|n)
error_msg "Installation canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}
function remove_guppyflo(){
guppyflo_message
local yn
while true; do
remove_msg "GuppyFLO" yn
case "${yn}" in
Y|y)
echo -e "${white}"
if [ -f "$INITD_FOLDER"/S99guppyflo ]; then
echo -e "Info: Stopping GuppyFLO service..."
/etc/init.d/S99guppyflo stop &> /dev/null
fi
echo -e "Info: Removing files..."
rm -rf "$GUPPYFLO_FOLDER"
rm -f "$INITD_FOLDER"/S99guppyflo
rm -f /lib/libeinfo.so.1
rm -f /lib/librc.so.1
ok_msg "GuppyFLO has been removed successfully!"
return;;
N|n)
error_msg "Deletion canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}

View file

@ -47,6 +47,7 @@ function info_menu_ui_ke() {
info_line "$(check_folder_ke "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere' info_line "$(check_folder_ke "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
info_line "$(check_folder_ke "$MOONRAKER_OBICO_FOLDER")" 'Obico' info_line "$(check_folder_ke "$MOONRAKER_OBICO_FOLDER")" 'Obico'
info_line "$(check_folder_ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion' info_line "$(check_folder_ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
info_line "$(check_folder_ke "$GUPPYFLO_FOLDER")" 'GuppyFLO'
hr hr
subtitle '•CUSTOMIZATION:' subtitle '•CUSTOMIZATION:'
info_line "$(check_file_ke "$CREALITY_WEB_FILE")" 'Creality Web Interface' info_line "$(check_file_ke "$CREALITY_WEB_FILE")" 'Creality Web Interface'

View file

@ -29,6 +29,7 @@ function install_menu_ui_ke() {
menu_option '11' 'Install' 'OctoEverywhere' menu_option '11' 'Install' 'OctoEverywhere'
menu_option '12' 'Install' 'Moonraker Obico' menu_option '12' 'Install' 'Moonraker Obico'
menu_option '13' 'Install' 'Mobileraker Companion' menu_option '13' 'Install' 'Mobileraker Companion'
menu_option '14' 'Install' 'GuppyFLO'
hr hr
inner_line inner_line
hr hr
@ -150,6 +151,12 @@ function install_menu_ke() {
else else
run "install_mobileraker_companion" "install_menu_ui_ke" run "install_mobileraker_companion" "install_menu_ui_ke"
fi;; fi;;
14)
if [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
error_msg "Moonraker and Nginx are needed, please install them first!"
else
run "install_guppyflo" "install_menu_ui_ke"
fi;;
B|b) B|b)
clear; main_menu; break;; clear; main_menu; break;;
Q|q) Q|q)

View file

@ -29,6 +29,7 @@ function remove_menu_ui_ke() {
menu_option '11' 'Remove' 'OctoEverywhere' menu_option '11' 'Remove' 'OctoEverywhere'
menu_option '12' 'Remove' 'Moonraker Obico' menu_option '12' 'Remove' 'Moonraker Obico'
menu_option '13' 'Remove' 'Mobileraker Companion' menu_option '13' 'Remove' 'Mobileraker Companion'
menu_option '14' 'Remove' 'GuppyFLO'
hr hr
inner_line inner_line
hr hr
@ -146,6 +147,12 @@ function remove_menu_ke() {
else else
run "remove_mobileraker_companion" "remove_menu_ui_ke" run "remove_mobileraker_companion" "remove_menu_ui_ke"
fi;; fi;;
14)
if [ ! -d "$GUPPYFLO_FOLDER" ]; then
error_msg "GuppyFLO is not installed!"
else
run "remove_guppyflo" "remove_menu_ui_ke"
fi;;
B|b) B|b)
clear; main_menu; break;; clear; main_menu; break;;
Q|q) Q|q)

View file

@ -55,6 +55,7 @@ function info_menu_ui() {
info_line "$(check_folder "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere' info_line "$(check_folder "$OCTOEVERYWHERE_FOLDER")" 'OctoEverywhere'
info_line "$(check_folder "$MOONRAKER_OBICO_FOLDER")" 'Obico' info_line "$(check_folder "$MOONRAKER_OBICO_FOLDER")" 'Obico'
info_line "$(check_folder "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion' info_line "$(check_folder "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
info_line "$(check_folder "$GUPPYFLO_FOLDER")" 'GuppyFLO'
hr hr
subtitle '•CUSTOMIZATION:' subtitle '•CUSTOMIZATION:'
info_line "$(check_file "$BOOT_DISPLAY_FILE")" 'Custom Boot Display' info_line "$(check_file "$BOOT_DISPLAY_FILE")" 'Custom Boot Display'

View file

@ -37,6 +37,7 @@ function install_menu_ui() {
menu_option '19' 'Install' 'OctoEverywhere' menu_option '19' 'Install' 'OctoEverywhere'
menu_option '20' 'Install' 'Moonraker Obico' menu_option '20' 'Install' 'Moonraker Obico'
menu_option '21' 'Install' 'Mobileraker Companion' menu_option '21' 'Install' 'Mobileraker Companion'
menu_option '22' 'Install' 'GuppyFLO'
hr hr
inner_line inner_line
hr hr
@ -216,6 +217,12 @@ function install_menu() {
else else
run "install_mobileraker_companion" "install_menu_ui" run "install_mobileraker_companion" "install_menu_ui"
fi;; fi;;
22)
if [ ! -d "$MOONRAKER_FOLDER" ] && [ ! -d "$NGINX_FOLDER" ]; then
error_msg "Moonraker and Nginx are needed, please install them first!"
else
run "install_guppyflo" "install_menu_ui"
fi;;
B|b) B|b)
clear; main_menu; break;; clear; main_menu; break;;
Q|q) Q|q)

View file

@ -37,6 +37,7 @@ function remove_menu_ui() {
menu_option '19' 'Remove' 'OctoEverywhere' menu_option '19' 'Remove' 'OctoEverywhere'
menu_option '20' 'Remove' 'Moonraker Obico' menu_option '20' 'Remove' 'Moonraker Obico'
menu_option '21' 'Remove' 'Mobileraker Companion' menu_option '21' 'Remove' 'Mobileraker Companion'
menu_option '22' 'Remove' 'GuppyFLO'
hr hr
inner_line inner_line
hr hr
@ -208,6 +209,12 @@ function remove_menu() {
else else
run "remove_mobileraker_companion" "remove_menu_ui" run "remove_mobileraker_companion" "remove_menu_ui"
fi;; fi;;
22)
if [ ! -d "$GUPPYFLO_FOLDER" ]; then
error_msg "GuppyFLO is not installed!"
else
run "remove_guppyflo" "remove_menu_ui"
fi;;
B|b) B|b)
clear; main_menu; break;; clear; main_menu; break;;
Q|q) Q|q)

View file

@ -143,6 +143,10 @@ function set_paths() {
MOBILERAKER_COMPANION_FOLDER="${USR_DATA}/mobileraker_companion" MOBILERAKER_COMPANION_FOLDER="${USR_DATA}/mobileraker_companion"
MOBILERAKER_COMPANION_URL="https://github.com/Clon1998/mobileraker_companion.git" MOBILERAKER_COMPANION_URL="https://github.com/Clon1998/mobileraker_companion.git"
# GuppyFLO #
GUPPYFLO_FOLDER="${USR_DATA}/guppyflo"
GUPPYFLO_URL="https://github.com/ballaswag/guppyflo/releases/latest/download/guppyflo_mipsle.zip"
# Custom Boot Display # # Custom Boot Display #
BOOT_DISPLAY_FOLDER="/etc/boot-display" BOOT_DISPLAY_FOLDER="/etc/boot-display"
BOOT_DISPLAY_FILE="${BOOT_DISPLAY_FOLDER}/part0/pic_100.jpg" BOOT_DISPLAY_FILE="${BOOT_DISPLAY_FOLDER}/part0/pic_100.jpg"

View file

@ -358,6 +358,9 @@ function clear_logs(){
rm -f "$USR_DATA"/creality/userdata/log/*.gz rm -f "$USR_DATA"/creality/userdata/log/*.gz
rm -f "$USR_DATA"/creality/userdata/fault_code/* rm -f "$USR_DATA"/creality/userdata/fault_code/*
rm -f "$PRINTER_DATA_FOLDER"/logs/* rm -f "$PRINTER_DATA_FOLDER"/logs/*
if [ -d "$GUPPYFLO_FOLDER" ]; then
rm -f "$GUPPYFLO_FOLDER"/guppyflo.log
fi
ok_msg "Logs files have been cleared!" ok_msg "Logs files have been cleared!"
return;; return;;
N|n) N|n)