This commit is contained in:
Cyril 2024-03-31 23:35:16 +02:00
parent 041223591f
commit 9e9081e4cc
8 changed files with 126 additions and 0 deletions

View file

@ -20,6 +20,14 @@ function check_file_ke() {
fi
}
function check_simplyprint_ke() {
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
echo -e "${green}"
else
echo -e "${red}"
fi
}
function info_menu_ui_ke() {
top_line
title '[ INFORMATIONS MENU ]' "${yellow}"
@ -49,6 +57,7 @@ function info_menu_ui_ke() {
info_line "$(check_folder_ke "$GUPPYFLO_FOLDER")" 'GuppyFLO'
info_line "$(check_folder_ke "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
info_line "$(check_folder_ke "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
info_line "$(check_simplyprint_ke)" 'SimplyPrint'
hr
subtitle '•CUSTOMIZATION:'
info_line "$(check_file_ke "$CREALITY_WEB_FILE")" 'Creality Web Interface'

View file

@ -31,6 +31,7 @@ function install_menu_ui_ke() {
menu_option '13' 'Install' 'GuppyFLO'
menu_option '14' 'Install' 'Mobileraker Companion'
menu_option '15' 'Install' 'OctoApp Companion'
menu_option '16' 'Install' 'SimplyPrint'
hr
inner_line
hr
@ -174,6 +175,16 @@ function install_menu_ke() {
else
run "install_octoapp_companion" "install_menu_ui_ke"
fi;;
16)
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
error_msg "SimplyPrint is already installed!"
elif [ ! -d "$MOONRAKER_FOLDER" ]; then
error_msg "Moonraker and Nginx are needed, please install them first!"
elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
error_msg "Fluidd or Mainsail is needed, please install it first!"
else
run "install_simplyprint" "install_menu_ui_ke"
fi;;
B|b)
clear; main_menu; break;;
Q|q)

View file

@ -31,6 +31,7 @@ function remove_menu_ui_ke() {
menu_option '13' 'Remove' 'GuppyFLO'
menu_option '14' 'Remove' 'Mobileraker Companion'
menu_option '15' 'Remove' 'OctoApp Companion'
menu_option '16' 'Remove' 'SimplyPrint'
hr
inner_line
hr
@ -160,6 +161,12 @@ function remove_menu_ke() {
else
run "remove_octoapp_companion" "remove_menu_ui_ke"
fi;;
16)
if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
error_msg "SimplyPrint is not installed!"
else
run "remove_simplyprint" "remove_menu_ui"
fi;;
B|b)
clear; main_menu; break;;
Q|q)

View file

@ -20,6 +20,14 @@ function check_file() {
fi
}
function check_simplyprint() {
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
echo -e "${green}"
else
echo -e "${red}"
fi
}
function info_menu_ui() {
top_line
title '[ INFORMATIONS MENU ]' "${yellow}"
@ -57,6 +65,7 @@ function info_menu_ui() {
info_line "$(check_folder "$GUPPYFLO_FOLDER")" 'GuppyFLO'
info_line "$(check_folder "$MOBILERAKER_COMPANION_FOLDER")" 'Mobileraker Companion'
info_line "$(check_folder "$OCTOAPP_COMPANION_FOLDER")" 'OctoApp Companion'
info_line "$(check_simplyprint)" 'SimplyPrint'
hr
subtitle '•CUSTOMIZATION:'
info_line "$(check_file "$BOOT_DISPLAY_FILE")" 'Custom Boot Display'

View file

@ -39,6 +39,7 @@ function install_menu_ui() {
menu_option '21' 'Install' 'GuppyFLO'
menu_option '22' 'Install' 'Mobileraker Companion'
menu_option '23' 'Install' 'OctoApp Companion'
menu_option '24' 'Install' 'SimplyPrint'
hr
inner_line
hr
@ -240,6 +241,16 @@ function install_menu() {
else
run "install_octoapp_companion" "install_menu_ui"
fi;;
24)
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
error_msg "SimplyPrint is already installed!"
elif [ ! -d "$MOONRAKER_FOLDER" ]; then
error_msg "Moonraker and Nginx are needed, please install them first!"
elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
error_msg "Fluidd or Mainsail is needed, please install it first!"
else
run "install_simplyprint" "install_menu_ui"
fi;;
B|b)
clear; main_menu; break;;
Q|q)

View file

@ -39,6 +39,7 @@ function remove_menu_ui() {
menu_option '21' 'Remove' 'GuppyFLO'
menu_option '22' 'Remove' 'Mobileraker Companion'
menu_option '23' 'Remove' 'OctoApp Companion'
menu_option '24' 'Remove' 'SimplyPrint'
hr
inner_line
hr
@ -222,6 +223,12 @@ function remove_menu() {
else
run "remove_octoapp_companion" "remove_menu_ui"
fi;;
24)
if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
error_msg "SimplyPrint is not installed!"
else
run "remove_simplyprint" "remove_menu_ui"
fi;;
B|b)
clear; main_menu; break;;
Q|q)

View file

@ -53,6 +53,7 @@ function remove_octoapp_companion(){
echo -e "Info: Running OctoApp Companion uninstaller..."
cd "$OCTOAPP_COMPANION_FOLDER"
sh ./uninstall.sh
rm -f /root/update-OctoApp.sh
ok_msg "OctoApp Companion has been removed successfully!"
return;;
N|n)

71
scripts/simplyprint.sh Executable file
View file

@ -0,0 +1,71 @@
#!/bin/sh
set -e
function simplyprint_message(){
top_line
title 'SimplyPrint' "${yellow}"
inner_line
hr
echo -e "${cyan}SimplyPrint allows you to start those prints that you just ${white}"
echo -e "${cyan}need to be done sooner rather than later. You can send print ${white}"
echo -e "${cyan}jobs to your printer from anywhere in the world. ${white}"
hr
bottom_line
}
function install_simplyprint(){
simplyprint_message
local yn
while true; do
install_msg "SimplyPrint" yn
case "${yn}" in
Y|y)
echo -e "${white}"
if ! grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
echo -e "Info: Enabling SimplyPrint configurations in moonraker.conf file..."
sed -i -e '/\[simplyprint\]/!{ $s/$/\n\n[simplyprint]/;}' "$MOONRAKER_CFG"
else
echo -e "Info: SimplyPrint configurations are already enabled in moonraker.conf file..."
fi
echo -e "Info: Restarting Moonraker service..."
stop_moonraker
start_moonraker
ok_msg "SimplyPrint has been installed successfully!"
return;;
N|n)
error_msg "Installation canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}
function remove_simplyprint(){
simplyprint_message
local yn
while true; do
remove_msg "SimplyPrint" yn
case "${yn}" in
Y|y)
echo -e "${white}"
if grep -q "\[simplyprint\]" "$MOONRAKER_CFG"; then
echo "Info: Removing SimplyPrint configurations in moonraker.conf file..."
sed -i -e '/\[simplyprint\]/{x;d;};x' "$MOONRAKER_CFG"
else
echo "Info: SimplyPrint configurations are already removed in moonraker.conf file."
fi
echo -e "Info: Restarting Moonraker service..."
stop_moonraker
start_moonraker
ok_msg "SimplyPrint has been removed successfully!"
return;;
N|n)
error_msg "Deletion canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}