From a85eb1321747a0bbccfe33af0ff7851905bdc401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Norh=C3=B8j?= Date: Thu, 14 Jul 2022 20:17:05 +0200 Subject: [PATCH 1/2] When installing cloud plugins, the menu will not be shown after install and quitting is therefore hard if you don't remember the number for quit. It is unlikely that someone will want to use multiple cloud plugins. --- plugins.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins.sh b/plugins.sh index 9b070d5..008c882 100755 --- a/plugins.sh +++ b/plugins.sh @@ -52,5 +52,6 @@ plugin_menu_cloud() { fi plugin_path=$(cat $SCRIPTDIR/plugins_cloud | sed -n -e "s/^plugin:$plugin path:\([[:graph:]]*\)/\1/p") install_plugin + break done } From 9a60f738bb74dc1bccadc839e58e7be78f25b15b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Norh=C3=B8j?= Date: Thu, 14 Jul 2022 20:43:17 +0200 Subject: [PATCH 2/2] Check formatting on resolution --- octoprint_deploy.sh | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index 525c6a5..cbe0637 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -419,13 +419,20 @@ add_camera() { fi echo "Settings can be modified after initial setup in /etc/systemd/system/cam_$INSTANCE" echo - echo "Camera Resolution (no sanity check, so get it right) [default: 640x480]:" - read RESOLUTION - if [ -z "$RESOLUTION" ]; then - RESOLUTION="640x480" - fi + while true; do + echo "Camera Resolution [default: 640x480]:" + read RESOLUTION + if [ -z $RESOLUTION] + then + RESOLUTION="640x480" + break + elif [[ $RESOLUTION =~ ^[0-9]+x[0-9]+$ ]] + then + break + fi + echo "Invalid resolution" + done echo "Selected camera resolution: $RESOLUTION" | log - #TODO check formating echo "Camera Framerate (use 0 for ustreamer hardware) [default: 5]:" read FRAMERATE if [ -z "$FRAMERATE" ]; then