|
|
@ -4,7 +4,7 @@ APP_NAME="frigate"
|
|
|
|
|
|
|
|
|
|
|
|
ACTION="${1}"
|
|
|
|
ACTION="${1}"
|
|
|
|
shift 1
|
|
|
|
shift 1
|
|
|
|
set -x
|
|
|
|
#set -x
|
|
|
|
|
|
|
|
|
|
|
|
fetch_and_validate_uci () {
|
|
|
|
fetch_and_validate_uci () {
|
|
|
|
local config_name=$1
|
|
|
|
local config_name=$1
|
|
|
@ -12,11 +12,11 @@ fetch_and_validate_uci () {
|
|
|
|
|
|
|
|
|
|
|
|
local result=$(uci get frigate.$config_name.$config_attr 2>/dev/null)
|
|
|
|
local result=$(uci get frigate.$config_name.$config_attr 2>/dev/null)
|
|
|
|
if [ -z "$result" ]; then
|
|
|
|
if [ -z "$result" ]; then
|
|
|
|
echo "Error: $config_name not found in configuration."
|
|
|
|
echo "Error: $config_name not found in configuration." >&2
|
|
|
|
exit 1
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Fetched $config_name from configuration: $result"
|
|
|
|
echo "Fetched $config_name from configuration: $result" >&2
|
|
|
|
echo $result
|
|
|
|
echo $result
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -313,7 +313,7 @@ update_camera_in_yml() {
|
|
|
|
|
|
|
|
|
|
|
|
local mask=$(get_uci_camera_value $camera_index "mask")
|
|
|
|
local mask=$(get_uci_camera_value $camera_index "mask")
|
|
|
|
if [ -n "$mask" ]; then
|
|
|
|
if [ -n "$mask" ]; then
|
|
|
|
set_yml_value $name ".motion.mask" $mask
|
|
|
|
set_yml_value $name ".motion.mask" "[\"$mask\"]"
|
|
|
|
else
|
|
|
|
else
|
|
|
|
echo "Mask is empty, ignoring."
|
|
|
|
echo "Mask is empty, ignoring."
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|