add noserial command line option
This commit is contained in:
@@ -351,6 +351,7 @@ write_camera() {
|
|||||||
echo " stream: http://$(hostname).local:$CAMPORT?action=stream" >> $OCTOCONFIG/.$INSTANCE/config.yaml
|
echo " stream: http://$(hostname).local:$CAMPORT?action=stream" >> $OCTOCONFIG/.$INSTANCE/config.yaml
|
||||||
$OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config append_value --json system.actions "{\"action\": \"Reset video streamer\", \"command\": \"sudo systemctl restart cam_$INSTANCE\", \"name\": \"Restart webcam\"}"
|
$OCTOEXEC --basedir $OCTOCONFIG/.$INSTANCE config append_value --json system.actions "{\"action\": \"Reset video streamer\", \"command\": \"sudo systemctl restart cam_$INSTANCE\", \"name\": \"Restart webcam\"}"
|
||||||
#Either Serial number or USB port
|
#Either Serial number or USB port
|
||||||
|
|
||||||
#Serial Number
|
#Serial Number
|
||||||
if [ -n "$CAM" ]; then
|
if [ -n "$CAM" ]; then
|
||||||
echo SUBSYSTEM==\"video4linux\", ATTRS{serial}==\"$CAM\", ATTR{index}==\"0\", SYMLINK+=\"cam_$INSTANCE\" >> /etc/udev/rules.d/99-octoprint.rules
|
echo SUBSYSTEM==\"video4linux\", ATTRS{serial}==\"$CAM\", ATTR{index}==\"0\", SYMLINK+=\"cam_$INSTANCE\" >> /etc/udev/rules.d/99-octoprint.rules
|
||||||
@@ -388,7 +389,9 @@ add_camera() {
|
|||||||
|
|
||||||
if [ -z "$PI" ]; then
|
if [ -z "$PI" ]; then
|
||||||
detect_camera
|
detect_camera
|
||||||
|
if [ -n "$NOSERIAL" ]; then
|
||||||
|
unset $CAM
|
||||||
|
fi
|
||||||
#Failed state. Nothing detected
|
#Failed state. Nothing detected
|
||||||
if [ -z "$CAM" ] && [ -z "$TEMPUSBCAM" ] ; then
|
if [ -z "$CAM" ] && [ -z "$TEMPUSBCAM" ] ; then
|
||||||
echo
|
echo
|
||||||
@@ -1397,4 +1400,8 @@ fi
|
|||||||
if [ "$1" == picam ]; then
|
if [ "$1" == picam ]; then
|
||||||
add_camera true
|
add_camera true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "$1" == noserial ]; then
|
||||||
|
NOSERIAL=1
|
||||||
|
fi
|
||||||
main_menu
|
main_menu
|
||||||
|
|||||||
Reference in New Issue
Block a user