From c19ab0ac3f8af92dda0338b637c92bf81e468d38 Mon Sep 17 00:00:00 2001 From: lloydbayley Date: Sun, 13 Nov 2022 21:10:27 +1100 Subject: [PATCH 1/5] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 99afbb4..3221ebc 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,4 @@ exclude_species_list.txt firstrun.ini HUMAN.txt include_species_list.txt +.DS_Store From 4bf3c11bb86c42aec3a1b2ed5ebbc365f1b03b47 Mon Sep 17 00:00:00 2001 From: lloydbayley Date: Tue, 15 Nov 2022 21:45:28 +1100 Subject: [PATCH 2/5] Revert "Update .gitignore" This reverts commit c19ab0ac3f8af92dda0338b637c92bf81e468d38. --- birdnet.conf-defaults | 5 +++++ scripts/config.php | 6 ++++++ scripts/install_config.sh | 5 +++++ scripts/update_birdnet_snippets.sh | 5 +++++ 4 files changed, 21 insertions(+) diff --git a/birdnet.conf-defaults b/birdnet.conf-defaults index 542f14d..9193b9b 100644 --- a/birdnet.conf-defaults +++ b/birdnet.conf-defaults @@ -2,6 +2,11 @@ # Configuration settings for BirdNET-Pi # ################################################################################ +# Site Name - Optional + +SITE_NAME="" + + #--------------------- Required: Latitude, and Longitude ----------------------# ## Please only go to 4 decimal places. Example:43.3984 diff --git a/scripts/config.php b/scripts/config.php index c581528..7a64be2 100644 --- a/scripts/config.php +++ b/scripts/config.php @@ -22,6 +22,8 @@ if(isset($_GET['restart_php']) && $_GET['restart_php'] == "true") { if(isset($_GET["latitude"])){ $latitude = $_GET["latitude"]; $longitude = $_GET["longitude"]; + $site_name = $_GET["site_name"]; + $site_name = preg_replace( '/[^A-Za-z0-9 ]/' , "", $site_name); $birdweather_id = $_GET["birdweather_id"]; $apprise_input = $_GET['apprise_input']; $apprise_notification_title = $_GET['apprise_notification_title']; @@ -99,6 +101,7 @@ if(isset($_GET["latitude"])){ $contents = file_get_contents("/etc/birdnet/birdnet.conf"); + $contents = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents); $contents = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents); $contents = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents); $contents = preg_replace("/BIRDWEATHER_ID=.*/", "BIRDWEATHER_ID=$birdweather_id", $contents); @@ -114,6 +117,7 @@ if(isset($_GET["latitude"])){ $contents = preg_replace("/APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=.*/", "APPRISE_MINIMUM_SECONDS_BETWEEN_NOTIFICATIONS_PER_SPECIES=$minimum_time_limit", $contents); $contents2 = file_get_contents("./scripts/thisrun.txt"); + $contents2 = preg_replace("/SITE_NAME=.*/", "SITE_NAME=\"$site_name\"", $contents2); $contents2 = preg_replace("/LATITUDE=.*/", "LATITUDE=$latitude", $contents2); $contents2 = preg_replace("/LONGITUDE=.*/", "LONGITUDE=$longitude", $contents2); $contents2 = preg_replace("/BIRDWEATHER_ID=.*/", "BIRDWEATHER_ID=$birdweather_id", $contents2); @@ -295,6 +299,8 @@ function sendTestNotification(e) {

Location

+ + (Optional)

diff --git a/scripts/install_config.sh b/scripts/install_config.sh index 4d2c79d..09334ad 100755 --- a/scripts/install_config.sh +++ b/scripts/install_config.sh @@ -13,12 +13,17 @@ install_config() { # Configuration settings for BirdNET-Pi # ################################################################################ +# Optional: Site Title for banner + +SITE_NAME="$HOSTNAME" + #--------------------- Required: Latitude, and Longitude ----------------------# ## The shell substitution below guesses these based on your network. THESE NEED ## TO BE CHANGED TO STATIC VALUES ## Please only go to 4 decimal places. Example:43.3984 + LATITUDE=$(curl -s4 ifconfig.co/json | jq .latitude) LONGITUDE=$(curl -s4 ifconfig.co/json | jq .longitude) diff --git a/scripts/update_birdnet_snippets.sh b/scripts/update_birdnet_snippets.sh index 729f264..5f0170c 100755 --- a/scripts/update_birdnet_snippets.sh +++ b/scripts/update_birdnet_snippets.sh @@ -10,6 +10,11 @@ my_dir=$HOME/BirdNET-Pi/scripts sudo -E chown -R $USER:$USER $HOME/* sudo chmod -R g+wr $HOME/* +# Create blank sitename as it's optional. First time install will use $HOSTNAME. +if ! grep SITE_NAME /etc/birdnet/birdnet.conf &>/dev/null;then + sudo -u$USER echo "SITE_NAME=\"\"" >> /etc/birdnet/birdnet.conf +fi + if ! grep PRIVACY_THRESHOLD /etc/birdnet/birdnet.conf &>/dev/null;then sudo -u$USER echo "PRIVACY_THRESHOLD=0" >> /etc/birdnet/birdnet.conf git -C $HOME/BirdNET-Pi rm $my_dir/privacy_server.py From 157e8e4c5cf534cd207817811b08629aab02928a Mon Sep 17 00:00:00 2001 From: lloydbayley Date: Tue, 15 Nov 2022 21:49:48 +1100 Subject: [PATCH 3/5] Revert "Update .gitignore" This reverts commit c19ab0ac3f8af92dda0338b637c92bf81e468d38. --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3221ebc..99afbb4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,3 @@ exclude_species_list.txt firstrun.ini HUMAN.txt include_species_list.txt -.DS_Store From 5c4f2ca4346956ab5b89203200e6d5763027b5ff Mon Sep 17 00:00:00 2001 From: lloydbayley Date: Tue, 15 Nov 2022 21:51:18 +1100 Subject: [PATCH 4/5] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 3221ebc..99afbb4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,4 +18,3 @@ exclude_species_list.txt firstrun.ini HUMAN.txt include_species_list.txt -.DS_Store From ba358ec23c6122d44843d7de210b6b8bedf3c304 Mon Sep 17 00:00:00 2001 From: lloydbayley Date: Tue, 15 Nov 2022 21:56:09 +1100 Subject: [PATCH 5/5] Update index.php --- homepage/index.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/homepage/index.php b/homepage/index.php index dd7c0ae..9749eb9 100644 --- a/homepage/index.php +++ b/homepage/index.php @@ -16,6 +16,16 @@ echo ""; }?> + + +