From 93f6cea2111430a5b9c1a70f57a6eacccff914e7 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Wed, 28 Feb 2024 11:51:29 +0100 Subject: [PATCH 1/4] fix: fix ustreamer binary path for v5.52 changes Signed-off-by: Patrick Gehrsitz --- libs/core.sh | 10 +++++++--- libs/ustreamer.sh | 2 +- libs/versioncontrol.sh | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/libs/core.sh b/libs/core.sh index aab784df..088b15f3 100755 --- a/libs/core.sh +++ b/libs/core.sh @@ -82,11 +82,15 @@ function check_dep { function check_apps { local cstreamer ustreamer - ustreamer="bin/ustreamer/ustreamer" + ustreamer_base="bin/ustreamer" + ustreamer="$(find ${BASE_CN_PATH}/${ustreamer_base} \ + -iname 'ustreamer.bin' 2> /dev/null | sed '1q')" cstreamer="bin/camera-streamer/camera-streamer" - if [[ -x "${BASE_CN_PATH}/${ustreamer}" ]]; then - log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer}." + if [[ -x "${ustreamer}" ]]; then + log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer_base}/${ustreamer##*/}." + UST_BIN="${ustreamer}" + declare -r UST_BIN else log_msg "Dependency: '${ustreamer##*/}' not found. Exiting!" exit 1 diff --git a/libs/ustreamer.sh b/libs/ustreamer.sh index e4c7c451..40f9218f 100755 --- a/libs/ustreamer.sh +++ b/libs/ustreamer.sh @@ -31,7 +31,7 @@ run_mjpg() { run_ustreamer() { local cam_sec ust_bin dev pt res fps cstm start_param cam_sec="${1}" - ust_bin="${BASE_CN_PATH}/bin/ustreamer/ustreamer" + ust_bin="${UST_BIN}" dev="$(get_param "cam ${cam_sec}" device)" pt="$(get_param "cam ${cam_sec}" port)" res="$(get_param "cam ${cam_sec}" resolution)" diff --git a/libs/versioncontrol.sh b/libs/versioncontrol.sh index 2c7b1850..dc968193 100644 --- a/libs/versioncontrol.sh +++ b/libs/versioncontrol.sh @@ -28,7 +28,7 @@ versioncontrol() { local cur_ver avail_ver pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1 avail_ver="$(git describe --tags --always)" - cur_ver="v$("${PWD}"/ustreamer -v)" + cur_ver="v$("${UST_BIN}" -v)" if [[ "${cur_ver}" == "${avail_ver}" ]]; then vc_log_msg "ustreamer is up to date. (${cur_ver})" fi From f43e38e1afbedb01d07f528869a034c06fe8ed4f Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Wed, 28 Feb 2024 14:03:03 +0100 Subject: [PATCH 2/4] fix: fix some shellcheck error Signed-off-by: Patrick Gehrsitz --- libs/core.sh | 3 ++- libs/versioncontrol.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/core.sh b/libs/core.sh index 088b15f3..d37e2b73 100755 --- a/libs/core.sh +++ b/libs/core.sh @@ -83,13 +83,14 @@ function check_dep { function check_apps { local cstreamer ustreamer ustreamer_base="bin/ustreamer" - ustreamer="$(find ${BASE_CN_PATH}/${ustreamer_base} \ + ustreamer="$(find "${BASE_CN_PATH}"/"${ustreamer_base}" \ -iname 'ustreamer.bin' 2> /dev/null | sed '1q')" cstreamer="bin/camera-streamer/camera-streamer" if [[ -x "${ustreamer}" ]]; then log_msg "Dependency: '${ustreamer##*/}' found in ${ustreamer_base}/${ustreamer##*/}." UST_BIN="${ustreamer}" + # shellcheck disable=SC2034 declare -r UST_BIN else log_msg "Dependency: '${ustreamer##*/}' not found. Exiting!" diff --git a/libs/versioncontrol.sh b/libs/versioncontrol.sh index dc968193..e477c6fd 100644 --- a/libs/versioncontrol.sh +++ b/libs/versioncontrol.sh @@ -28,7 +28,7 @@ versioncontrol() { local cur_ver avail_ver pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1 avail_ver="$(git describe --tags --always)" - cur_ver="v$("${UST_BIN}" -v)" + cur_ver="v$(${UST_BIN} -v)" if [[ "${cur_ver}" == "${avail_ver}" ]]; then vc_log_msg "ustreamer is up to date. (${cur_ver})" fi From ba654d0ea517b335d4cebebbaefc8dc1c7b33942 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Wed, 28 Feb 2024 16:09:17 +0100 Subject: [PATCH 3/4] fix: fix shellcheck Signed-off-by: Patrick Gehrsitz --- libs/versioncontrol.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/versioncontrol.sh b/libs/versioncontrol.sh index e477c6fd..e57dbfc4 100644 --- a/libs/versioncontrol.sh +++ b/libs/versioncontrol.sh @@ -28,6 +28,7 @@ versioncontrol() { local cur_ver avail_ver pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1 avail_ver="$(git describe --tags --always)" + # shellcheck disable=SC2153 cur_ver="v$(${UST_BIN} -v)" if [[ "${cur_ver}" == "${avail_ver}" ]]; then vc_log_msg "ustreamer is up to date. (${cur_ver})" From b49cef8adec17118d9eceb51b54a7096a771fc45 Mon Sep 17 00:00:00 2001 From: Patrick Gehrsitz Date: Wed, 28 Feb 2024 16:12:27 +0100 Subject: [PATCH 4/4] fix: fix shellcheck (this time for real) Signed-off-by: Patrick Gehrsitz --- libs/ustreamer.sh | 1 + libs/versioncontrol.sh | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/ustreamer.sh b/libs/ustreamer.sh index 40f9218f..88fc1a33 100755 --- a/libs/ustreamer.sh +++ b/libs/ustreamer.sh @@ -31,6 +31,7 @@ run_mjpg() { run_ustreamer() { local cam_sec ust_bin dev pt res fps cstm start_param cam_sec="${1}" + # shellcheck disable=SC2153 ust_bin="${UST_BIN}" dev="$(get_param "cam ${cam_sec}" device)" pt="$(get_param "cam ${cam_sec}" port)" diff --git a/libs/versioncontrol.sh b/libs/versioncontrol.sh index e57dbfc4..e477c6fd 100644 --- a/libs/versioncontrol.sh +++ b/libs/versioncontrol.sh @@ -28,7 +28,6 @@ versioncontrol() { local cur_ver avail_ver pushd "${BASE_CN_PATH}"/bin/ustreamer &> /dev/null || exit 1 avail_ver="$(git describe --tags --always)" - # shellcheck disable=SC2153 cur_ver="v$(${UST_BIN} -v)" if [[ "${cur_ver}" == "${avail_ver}" ]]; then vc_log_msg "ustreamer is up to date. (${cur_ver})"