REFACTOR: Refactored ustreamer.sh to avoid shellcheck errors
Signed-off-by: Stephan Wendel <me@stephanwe.de>
This commit is contained in:
parent
4b6fc0d8c3
commit
4c2d927d87
@ -28,7 +28,7 @@ function run_ustreamer {
|
|||||||
raspicam="$(v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
raspicam="$(v4l2-ctl --list-devices | grep -A1 -e 'mmal' | \
|
||||||
awk 'NR==2 {print $1}')"
|
awk 'NR==2 {print $1}')"
|
||||||
check_section "${cam_section}"
|
check_section "${cam_section}"
|
||||||
wwwroot="$(dirname $(readlink -qe $(whereis webcamd)))/ustreamer-www"
|
wwwroot="${BASE_CN_PATH}/ustreamer-www"
|
||||||
#Raspicam Workaround
|
#Raspicam Workaround
|
||||||
if [ "${device}" == "${raspicam}" ]; then
|
if [ "${device}" == "${raspicam}" ]; then
|
||||||
start_param=(
|
start_param=(
|
||||||
@ -45,7 +45,7 @@ function run_ustreamer {
|
|||||||
fi
|
fi
|
||||||
# Custom Flag Handling
|
# Custom Flag Handling
|
||||||
if [ -n "${custom}" ]; then
|
if [ -n "${custom}" ]; then
|
||||||
start_param=(${start_param[@]} "${custom}" )
|
start_param+=("${custom}")
|
||||||
fi
|
fi
|
||||||
log_msg "Starting ustreamer with Device ${device} ..."
|
log_msg "Starting ustreamer with Device ${device} ..."
|
||||||
echo "Parameters: ${start_param[*]}" | \
|
echo "Parameters: ${start_param[*]}" | \
|
||||||
@ -53,7 +53,7 @@ function run_ustreamer {
|
|||||||
# Ustreamer is designed to run even if the device is not ready or readable.
|
# Ustreamer is designed to run even if the device is not ready or readable.
|
||||||
# I dont like that! ustreamer has to exit if Cam isnt there.
|
# I dont like that! ustreamer has to exit if Cam isnt there.
|
||||||
if [ -e "${device}" ]; then
|
if [ -e "${device}" ]; then
|
||||||
"${ustreamer_bin}" ${start_param[*]} 2>&1 | \
|
echo "${start_param[*]}" | xargs "${ustreamer_bin}" 2>&1 | \
|
||||||
log_output "ustreamer [cam ${cam_section}]"
|
log_output "ustreamer [cam ${cam_section}]"
|
||||||
else
|
else
|
||||||
log_msg "ERROR: Start of ustreamer [cam ${cam_section}] failed!"
|
log_msg "ERROR: Start of ustreamer [cam ${cam_section}] failed!"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user