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 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 }