1
1
#! /bin/bash
2
2
3
- # #######################################################################
4
- # ## DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ###
5
- # ## ---------------------------------------------------------------- ###
6
- # ## There is no need to edit this file for changing resolution, ###
7
- # ## frame rates or any other mjpg-streamer parameters. Please edit ###
8
- # ## /boot/octopi.txt instead - that's what it's there for! You can ###
9
- # ## even do this with your Pi powered down by directly accessing the ###
10
- # ## file when using the SD card as thumb drive in your regular ###
11
- # ## computer. ###
12
- # #######################################################################
3
+ # ##############################################################################
4
+ # ## DO NOT EDIT THIS FILE TO CHANGE THE CONFIG!!! ###
5
+ # ## ----------------------------------------------------------------------- ###
6
+ # ## There is no need to edit this file for changing resolution, ###
7
+ # ## frame rates or any other mjpg-streamer parameters. Please edit ###
8
+ # ## /boot/firmware/ octopi.txt instead - that's what it's there for! You can ###
9
+ # ## even do this with your Pi powered down by directly accessing the ###
10
+ # ## file when using the SD card as thumb drive in your regular ###
11
+ # ## computer. ###
12
+ # ##############################################################################
13
13
14
14
MJPGSTREAMER_HOME=/opt/mjpg-streamer
15
15
MJPGSTREAMER_INPUT_USB=" input_uvc.so"
16
16
MJPGSTREAMER_INPUT_RASPICAM=" input_raspicam.so"
17
17
18
+ CONFIG_FILE=/boot/firmware/octopi.txt
19
+ # Fallback for older images
20
+ if [ ! -f " ${CONFIG_FILE} " ] && [ -f " /boot/octopi.txt" ]; then
21
+ CONFIG_FILE=/boot/octopi.txt
22
+ fi
23
+
18
24
brokenfps_usb_devices=(" 046d:082b" " 1908:2310" " 0458:708c" " 0458:6006" " 1e4e:0102" " 0471:0311" " 038f:6001" " 046d:0804" " 046d:0994" " 0ac8:3450" )
19
25
20
- config_dir=" /boot /octopi.conf.d"
26
+ config_dir=" ${CONFIG_FILE} /octopi.conf.d"
21
27
22
28
echo " Starting up webcamDaemon..."
23
29
echo " "
24
30
25
31
cfg_files=()
26
- cfg_files+=/boot/octopi.txt
32
+ cfg_files+=" ${CONFIG_FILE} "
27
33
if [[ -d ${config_dir} ]]; then
28
34
cfg_files+=( ` ls ${config_dir} /* .txt` )
29
35
fi
@@ -41,7 +47,7 @@ array_assigned_device=()
41
47
42
48
echo " --- Configuration: ----------------------------"
43
49
for cfg_file in ${cfg_files[@]} ; do
44
- # init configuration - DO NOT EDIT, USE /boot/octopi.conf.d/*.txt INSTEAD!
50
+ # init configuration - DO NOT EDIT, USE /boot/firmware/ octopi.conf.d/*.txt INSTEAD!
45
51
camera=" auto"
46
52
camera_usb_options=" -r 640x480 -f 10"
47
53
camera_raspi_options=" -fps 10"
@@ -54,7 +60,7 @@ for cfg_file in ${cfg_files[@]}; do
54
60
fi
55
61
usb_options=" $camera_usb_options "
56
62
57
- # if webcam device is explicitly given in /boot/octopi.txt, save the path of the device
63
+ # if webcam device is explicitly given in /boot/firmware/ octopi.txt, save the path of the device
58
64
# to a variable and remove its parameter from usb_options
59
65
extracted_device=` echo $usb_options | sed ' s@.*-d \(/dev/\(video[0-9]\+\|v4l/[^ ]*\)\).*@\1@' `
60
66
if [ " $extracted_device " != " $usb_options " ]
0 commit comments