Merge branch 'BirdNET-pi-main' into More-Misc-Fixes-and-Enhancements_mcguire

This commit is contained in:
jaredb7
2023-04-09 18:46:25 +10:00
3 changed files with 44 additions and 41 deletions
+2
View File
@@ -52,6 +52,8 @@ if(isset($_GET['submit'])) {
if(isset($_GET["birdnetpi_url"])) { if(isset($_GET["birdnetpi_url"])) {
$birdnetpi_url = $_GET["birdnetpi_url"]; $birdnetpi_url = $_GET["birdnetpi_url"];
// remove trailing slash to prevent conf from becoming broken
$birdnetpi_url = rtrim($birdnetpi_url, '/');
if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) { if(strcmp($birdnetpi_url,$config['BIRDNETPI_URL']) !== 0) {
$contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents); $contents = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents);
$contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2); $contents2 = preg_replace("/BIRDNETPI_URL=.*/", "BIRDNETPI_URL=$birdnetpi_url", $contents2);
+2
View File
@@ -481,6 +481,7 @@ h1 {
<script> <script>
var rtsp_stream_select = document.getElementById("rtsp_stream_select"); var rtsp_stream_select = document.getElementById("rtsp_stream_select");
if (typeof (rtsp_stream_select) !== 'undefined' && rtsp_stream_select !== null) {
//When the dropdown selection is changed set the new value is settings, then restart the livestream service so it broadcasts newly selected RTSP stream //When the dropdown selection is changed set the new value is settings, then restart the livestream service so it broadcasts newly selected RTSP stream
rtsp_stream_select.onchange = function () { rtsp_stream_select.onchange = function () {
if (this.value !== 'undefined') { if (this.value !== 'undefined') {
@@ -524,6 +525,7 @@ rtsp_stream_select.onchange = function() {
} }
} }
} }
}
var slider = document.getElementById("gain_input"); var slider = document.getElementById("gain_input");
var output = document.getElementById("gain_value"); var output = document.getElementById("gain_value");
+4 -5
View File
@@ -9,8 +9,8 @@ my_dir=$HOME/BirdNET-Pi/scripts
# Sets proper permissions and ownership # Sets proper permissions and ownership
#sudo -E chown -R $USER:$USER $HOME/* #sudo -E chown -R $USER:$USER $HOME/*
#sudo chmod -R g+wr $HOME/* #sudo chmod -R g+wr $HOME/*
find $HOME/* -not -user $USER -execdir sudo -E chown $USER:$USER {} \+ find $HOME/Bird* -not -user $USER -execdir sudo -E chown $USER:$USER {} \+
find $HOME/* -not -user $USER -execdir sudo chmod g+wr {} \+ find $HOME/Bird* -not -user $USER -execdir sudo chmod g+wr {} \+
chmod 666 ~/BirdNET-Pi/scripts/*.txt chmod 666 ~/BirdNET-Pi/scripts/*.txt
chmod 666 ~/BirdNET-Pi/*.txt chmod 666 ~/BirdNET-Pi/*.txt
find $HOME/BirdNET-Pi -path "$HOME/BirdNET-Pi/birdnet" -prune -o -type f ! -perm /o=w -exec chmod a+w {} \; find $HOME/BirdNET-Pi -path "$HOME/BirdNET-Pi/birdnet" -prune -o -type f ! -perm /o=w -exec chmod a+w {} \;
@@ -130,8 +130,7 @@ if ! grep '\-\-browser.gatherUsageStats false' $HOME/BirdNET-Pi/templates/birdne
fi fi
# Make IceCast2 a little more secure # Make IceCast2 a little more secure
sudo sed -i 's|<!-- <bind-address>.*|<bind-address>127.0.0.1</bind-address>|;s|<!-- <shoutcast-mount>.*|<shoutcast-mount>/stream</shoutcast-mount>|' /etc/icecast2/icecast.xml sudo sed -i.bak -e 's|<!-- <bind-address>.*|<bind-address>127.0.0.1</bind-address>|;s|<!-- <shoutcast-mount>.*|<shoutcast-mount>/stream</shoutcast-mount>|' /etc/icecast2/icecast.xml && if [ -s /etc/icecast2/icecast.xml.bak ] && ! sudo diff /etc/icecast2/icecast.xml /etc/icecast2/icecast.xml.bak > /dev/null; then sudo systemctl restart icecast2; fi
sudo systemctl restart icecast2
if ! grep FREQSHIFT_TOOL /etc/birdnet/birdnet.conf &>/dev/null;then if ! grep FREQSHIFT_TOOL /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "FREQSHIFT_TOOL=sox" >> /etc/birdnet/birdnet.conf sudo -u$USER echo "FREQSHIFT_TOOL=sox" >> /etc/birdnet/birdnet.conf
@@ -162,7 +161,7 @@ CREATE INDEX IF NOT EXISTS "detections_Com_Name" ON "detections" ("Com_Name");
CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC); CREATE INDEX IF NOT EXISTS "detections_Date_Time" ON "detections" ("Date" DESC, "Time" DESC);
EOF EOF
apprise_version=$($HOME/BirdNET-Pi/birdnet/bin/pip3 show apprise 2>/dev/null | grep Version | awk '{print $2}') apprise_version=$($HOME/BirdNET-Pi/birdnet/bin/python3 -c "import apprise; print(apprise.__version__)")
streamlit_version=$($HOME/BirdNET-Pi/birdnet/bin/pip3 show streamlit 2>/dev/null | grep Version | awk '{print $2}') streamlit_version=$($HOME/BirdNET-Pi/birdnet/bin/pip3 show streamlit 2>/dev/null | grep Version | awk '{print $2}')
[[ $apprise_version != "1.2.1" ]] && $HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1 [[ $apprise_version != "1.2.1" ]] && $HOME/BirdNET-Pi/birdnet/bin/pip3 install apprise==1.2.1