diff --git a/octoprint_deploy.sh b/octoprint_deploy.sh index 51c32db..79c9bfe 100755 --- a/octoprint_deploy.sh +++ b/octoprint_deploy.sh @@ -380,14 +380,18 @@ write_camera() { echo $CAMPORT >> /etc/camera_ports #config.yaml modifications - only if INUM not set if [ -z "$INUM" ]; then - echo "webcam:" >> $OCTOCONFIG/.$INSTANCE/config.yaml - echo " snapshot: http://$(hostname).local:$CAMPORT?action=snapshot" >> $OCTOCONFIG/.$INSTANCE/config.yaml + $OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config plugins.classicwebcam.snapshot set "http://localhost:$CAMPORT?action=snapshot" + if [ -z "$CAMHAPROXY" ]; then - echo " stream: http://$(hostname).local:$CAMPORT?action=stream" >> $OCTOCONFIG/.$INSTANCE/config.yaml + $OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config plugins.classicwebcam.stream set "http://$(hostname).local:$CAMPORT?action=stream" else - echo " stream: /cam_$INSTANCE/?action=stream" >> $OCTOCONFIG/.$INSTANCE/config.yaml + $OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config plugins.classicwebcam.stream set "/cam_$INSTANCE/?action=stream" fi $OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config append_value --json system.actions "{\"action\": \"Reset video streamer\", \"command\": \"sudo systemctl restart cam_$INSTANCE\", \"name\": \"Restart webcam\"}" + + if prompt_confirm "Instance must be restarted for settings to take effect. Restart now?"; then + systemctl restart $INSTANCE + fi fi #Either Serial number or USB port