Skip to content

A live bird collage card for your Home Assistant dashboard.

removed sudo from root script

Patrick McGuire6860d197a39e
diff --git a/scripts/birdnet_analysis.sh b/scripts/birdnet_analysis.sh
index f7d6ff0e..7d5d60b3 100755
--- a/scripts/birdnet_analysis.sh
+++ b/scripts/birdnet_analysis.sh
@@ -91,18 +91,18 @@ run_analysis() {
if [ "${RECORDING_LENGTH}" == "01:00" ];then
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "${RECORDING_LENGTH}" ];do
sleep 1
- [ $a -ge 60 ] && sudo rm -f ${1}/${i} && break
- a=$((a+1))
+ [ $a -ge 60 ] && sudo rm -f ${1}/${i} && break
+ a=$((a+1))
done
else
until [ "$(ffmpeg -i ${1}/${i} 2>&1 | awk -F. '/Duration/ {print $1}' | cut -d':' -f3-4)" == "00:${RECORDING_LENGTH}" ];do
sleep 1
- [ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break
- a=$((a+1))
+ [ $a -ge ${RECORDING_LENGTH} ] && sudo rm -f ${1}/${i} && break
+ a=$((a+1))
done
fi
- if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ];then
+ if [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ] && [ -z $STATION_NUMBER ];then
echo "python3 analyze.py \
--i "${1}/${i}" \
--o "${1}/${i}.csv" \
@@ -119,9 +119,9 @@ run_analysis() {
--lon "${LONGITUDE}" \
--week "${WEEK}" \
--overlap "${OVERLAP}" \
- --sensitivity "${SENSITIVITY}" \
+ --sensitivity "${SENSITIVITY}" \
--min_conf "${CONFIDENCE}"
- elif [ -f ${1}/${i} ] && [ -f ${CUSTOM_LIST} ];then
+ elif [ -f ${1}/${i} ] && [ -f ${CUSTOM_LIST} ] && [ -z $STATION_NUMBER ];then
echo "python3 analyze.py \
--i "${1}/${i}" \
--o "${1}/${i}.csv" \
@@ -139,10 +139,58 @@ run_analysis() {
--lon "${LONGITUDE}" \
--week "${WEEK}" \
--overlap "${OVERLAP}" \
- --sensitivity "${SENSITIVITY}" \
+ --sensitivity "${SENSITIVITY}" \
--min_conf "${CONFIDENCE}" \
- --custom_list "${CUSTOM_LIST}"
- fi
+ --custom_list "${CUSTOM_LIST}"
+ elif [ -f ${1}/${i} ] && [ ! -f ${CUSTOM_LIST} ] && [ ! -z $STATION_NUMBER ];then
+ echo "python3 analyze.py \
+--i "${1}/${i}" \
+--o "${1}/${i}.csv" \
+--lat "${LATITUDE}" \
+--lon "${LONGITUDE}" \
+--week "${WEEK}" \
+--overlap "${OVERLAP}" \
+--sensitivity "${SENSITIVITY}" \
+--min_conf "${CONFIDENCE}" \
+--s "${STATION_NUMBER}"\
+--meta_data "${STATION_NAME}""
+ "${VENV}"/bin/python analyze.py \
+ --i "${1}/${i}" \
+ --o "${1}/${i}.csv" \
+ --lat "${LATITUDE}" \
+ --lon "${LONGITUDE}" \
+ --week "${WEEK}" \
+ --overlap "${OVERLAP}" \
+ --sensitivity "${SENSITIVITY}" \
+ --min_conf "${CONFIDENCE}" \
+ --s "${STATION_NUMBER}"\
+ --meta_data "${STATION_NAME}"
+ elif [ -f ${1}/${i} ] && [ -f ${CUSTOM_LIST} ] && [ ! -z $STATION_NUMBER ];then
+ echo "python3 analyze.py \
+--i "${1}/${i}" \
+--o "${1}/${i}.csv" \
+--lat "${LATITUDE}" \
+--lon "${LONGITUDE}" \
+--week "${WEEK}" \
+--overlap "${OVERLAP}" \
+--sensitivity "${SENSITIVITY}" \
+--min_conf "${CONFIDENCE}" \
+--custom_list "${CUSTOM_LIST}"\
+--s "${STATION_NUMBER}"\
+--meta_data "${STATION_NAME}""
+ "${VENV}"/bin/python analyze.py \
+ --i "${1}/${i}" \
+ --o "${1}/${i}.csv" \
+ --lat "${LATITUDE}" \
+ --lon "${LONGITUDE}" \
+ --week "${WEEK}" \
+ --overlap "${OVERLAP}" \
+ --sensitivity "${SENSITIVITY}" \
+ --min_conf "${CONFIDENCE}" \
+ --custom_list "${CUSTOM_LIST}"\
+ --s "${STATION_NUMBER}"\
+ --meta_data "${STATION_NAME}"
+ fi
done
}
diff --git a/scripts/install_services.sh b/scripts/install_services.sh
index 161e430f..738a4d65 100755
--- a/scripts/install_services.sh
+++ b/scripts/install_services.sh
@@ -317,7 +317,7 @@ ExecStart=/usr/local/bin/daily_plot.py
[Install]
WantedBy=multi-user.target
EOF
- sudo systemctl enable chart_viewer.service
+ systemctl enable chart_viewer.service
}
install_gotty_logs() {
diff --git a/scripts/update_services.sh b/scripts/update_services.sh
index af149ed1..9cd974c4 100755
--- a/scripts/update_services.sh
+++ b/scripts/update_services.sh
@@ -315,7 +315,7 @@ ExecStart=/usr/local/bin/daily_plot.py
[Install]
WantedBy=multi-user.target
EOF
- sudo systemctl enable chart_viewer.service
+ systemctl enable chart_viewer.service
}
install_gotty_logs() {