Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions scripts/menu/10SE/install_menu_10SE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function install_menu_ui_10se() {
menu_option '15' 'Install' 'Mobileraker Companion'
menu_option '16' 'Install' 'OctoApp Companion'
menu_option '17' 'Install' 'SimplyPrint'
menu_option '18' 'Install' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -198,6 +199,18 @@ function install_menu_10se() {
else
run "install_simplyprint" "install_menu_ui_10se"
fi;;
18)
if [ -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud 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 one of them first!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_polarcloud" "install_menu_ui_10se"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
7 changes: 7 additions & 0 deletions scripts/menu/10SE/remove_menu_10SE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ function remove_menu_ui_10se() {
menu_option '15' 'Remove' 'Mobileraker Companion'
menu_option '16' 'Remove' 'OctoApp Companion'
menu_option '17' 'Remove' 'SimplyPrint'
menu_option '18' 'Remove' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -178,6 +179,12 @@ function remove_menu_10se() {
else
run "remove_simplyprint" "remove_menu_ui_10se"
fi;;
18)
if [ ! -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is not installed!"
else
run "remove_polarcloud" "remove_menu_ui_10se"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
13 changes: 13 additions & 0 deletions scripts/menu/3KE/install_menu_3KE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function install_menu_ui_3ke() {
menu_option '17' 'Install' 'Mobileraker Companion'
menu_option '18' 'Install' 'OctoApp Companion'
menu_option '19' 'Install' 'SimplyPrint'
menu_option '20' 'Install' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -212,6 +213,18 @@ function install_menu_3ke() {
else
run "install_simplyprint" "install_menu_ui_3ke"
fi;;
20)
if [ -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud 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 one of them first!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_polarcloud" "install_menu_ui_3ke"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
7 changes: 7 additions & 0 deletions scripts/menu/3KE/remove_menu_3KE.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function remove_menu_ui_3ke() {
menu_option '17' 'Remove' 'Mobileraker Companion'
menu_option '18' 'Remove' 'OctoApp Companion'
menu_option '19' 'Remove' 'SimplyPrint'
menu_option '20' 'Remove' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -192,6 +193,12 @@ function remove_menu_3ke() {
else
run "remove_simplyprint" "remove_menu_ui_3ke"
fi;;
20)
if [ ! -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is not installed!"
else
run "remove_polarcloud" "remove_menu_ui_3ke"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
13 changes: 13 additions & 0 deletions scripts/menu/3V3/install_menu_3V3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function install_menu_ui_3v3() {
menu_option '19' 'Install' 'Mobileraker Companion'
menu_option '20' 'Install' 'OctoApp Companion'
menu_option '21' 'Install' 'SimplyPrint'
menu_option '22' 'Install' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -230,6 +231,18 @@ function install_menu_3v3() {
else
run "install_simplyprint" "install_menu_ui_3v3"
fi;;
22)
if [ -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is already installed!"
elif [ ! -d "$MOONRAKER_FOLDER" ]; then
error_msg "Updated Moonraker is needed, please install it first!"
elif [ ! -d "$FLUIDD_FOLDER" ] && [ ! -d "$MAINSAIL_FOLDER" ]; then
error_msg "Updated Fluidd or Mainsail is needed, please install one of them first!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_polarcloud" "install_menu_ui_3v3"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
7 changes: 7 additions & 0 deletions scripts/menu/3V3/remove_menu_3V3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function remove_menu_ui_3v3() {
menu_option '19' 'Remove' 'Mobileraker Companion'
menu_option '20' 'Remove' 'OctoApp Companion'
menu_option '21' 'Remove' 'SimplyPrint'
menu_option '22' 'Remove' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -204,6 +205,12 @@ function remove_menu_3v3() {
else
run "remove_simplyprint" "remove_menu_ui_3v3"
fi;;
22)
if [ ! -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is not installed!"
else
run "remove_polarcloud" "remove_menu_ui_3v3"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
13 changes: 13 additions & 0 deletions scripts/menu/E5M/install_menu_E5M.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function install_menu_ui_e5m() {
menu_option '22' 'Install' 'Mobileraker Companion'
menu_option '23' 'Install' 'OctoApp Companion'
menu_option '24' 'Install' 'SimplyPrint'
menu_option '25' 'Install' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -249,6 +250,18 @@ function install_menu_e5m() {
else
run "install_simplyprint" "install_menu_ui_e5m"
fi;;
25)
if [ -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud 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 one of them first!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_polarcloud" "install_menu_ui_e5m"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
7 changes: 7 additions & 0 deletions scripts/menu/E5M/remove_menu_E5M.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function remove_menu_ui_e5m() {
menu_option '22' 'Remove' 'Mobileraker Companion'
menu_option '23' 'Remove' 'OctoApp Companion'
menu_option '24' 'Remove' 'SimplyPrint'
menu_option '25' 'Remove' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -233,6 +234,12 @@ function remove_menu_e5m() {
else
run "remove_simplyprint" "remove_menu_ui_e5m"
fi;;
25)
if [ ! -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is not installed!"
else
run "remove_polarcloud" "remove_menu_ui_e5m"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
13 changes: 13 additions & 0 deletions scripts/menu/K1/install_menu_K1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function install_menu_ui_k1() {
menu_option '22' 'Install' 'Mobileraker Companion'
menu_option '23' 'Install' 'OctoApp Companion'
menu_option '24' 'Install' 'SimplyPrint'
menu_option '25' 'Install' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -249,6 +250,18 @@ function install_menu_k1() {
else
run "install_simplyprint" "install_menu_ui_k1"
fi;;
25)
if [ -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud 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 one of them first!"
elif [ ! -f "$ENTWARE_FILE" ]; then
error_msg "Entware is needed, please install it first!"
else
run "install_polarcloud" "install_menu_ui_k1"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
7 changes: 7 additions & 0 deletions scripts/menu/K1/remove_menu_K1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function remove_menu_ui_k1() {
menu_option '22' 'Remove' 'Mobileraker Companion'
menu_option '23' 'Remove' 'OctoApp Companion'
menu_option '24' 'Remove' 'SimplyPrint'
menu_option '25' 'Remove' 'Polar Cloud'
hr
inner_line
hr
Expand Down Expand Up @@ -233,6 +234,12 @@ function remove_menu_k1() {
else
run "remove_simplyprint" "remove_menu_ui_k1"
fi;;
25)
if [ ! -d "$POLARCLOUD_FOLDER" ]; then
error_msg "Polar Cloud is not installed!"
else
run "remove_polarcloud" "remove_menu_ui_k1"
fi;;
B|b)
clear; main_menu; break;;
Q|q)
Expand Down
4 changes: 4 additions & 0 deletions scripts/paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ function set_paths() {
OCTOAPP_COMPANION_FOLDER="${USR_DATA}/octoapp"
OCTOAPP_COMPANION_URL="https://github.com/crysxd/OctoApp-Plugin.git"

# Polar Cloud #
POLARCLOUD_FOLDER="${USR_DATA}/polar-cloud-klipper"
POLARCLOUD_URL="https://github.com/Polar3D/polar-cloud-klipper.git"

# Custom Boot Display #
BOOT_DISPLAY_FOLDER="/etc/boot-display"
BOOT_DISPLAY_FILE="${BOOT_DISPLAY_FOLDER}/part0/pic_100.jpg"
Expand Down
68 changes: 68 additions & 0 deletions scripts/polarcloud.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh

set -e

function polarcloud_message(){
top_line
title 'Polar Cloud' "${yellow}"
inner_line
hr
echo -e " │ ${cyan}Polar Cloud provides remote access and monitoring for your ${white}│"
echo -e " │ ${cyan}3D printer. Connect to your printer from anywhere, manage ${white}│"
echo -e " │ ${cyan}print jobs, and access cloud-based slicing features. ${white}│"
hr
bottom_line
}

function install_polarcloud(){
polarcloud_message
local yn
while true; do
install_msg "Polar Cloud" yn
case "${yn}" in
Y|y)
echo -e "${white}"
if [ -d "$POLARCLOUD_FOLDER" ]; then
echo -e "Info: Polar Cloud is already installed. Download skipped."
else
echo -e "Info: Downloading Polar Cloud..."
git config --global http.sslVerify false
git clone "$POLARCLOUD_URL" "$POLARCLOUD_FOLDER"
fi
echo -e "Info: Running Polar Cloud installer..."
cd "$POLARCLOUD_FOLDER"
sh ./install.sh
echo
ok_msg "Polar Cloud has been installed successfully!"
return;;
N|n)
error_msg "Installation canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}

function remove_polarcloud(){
polarcloud_message
local yn
while true; do
remove_msg "Polar Cloud" yn
case "${yn}" in
Y|y)
echo -e "${white}"
echo -e "Info: Running Polar Cloud uninstaller..."
cd "$POLARCLOUD_FOLDER"
sh ./uninstall.sh
echo
ok_msg "Polar Cloud has been removed successfully!"
return;;
N|n)
error_msg "Deletion canceled!"
return;;
*)
error_msg "Please select a correct choice!";;
esac
done
}