Notification conf and cron setups

This commit is contained in:
ehpersonal38
2022-06-28 13:04:59 -04:00
parent 828d9d8757
commit 5896f00a55
6 changed files with 18 additions and 0 deletions
+1
View File
@@ -62,6 +62,7 @@ APPRISE_NOTIFICATION_TITLE="New BirdNET-Pi Detection"
APPRISE_NOTIFICATION_BODY="A \$sciname \$comname was just detected with a confidence of \$confidence"
APPRISE_NOTIFY_EACH_DETECTION=0
APPRISE_NOTIFY_NEW_SPECIES=0
APPRISE_WEEKLY_REPORT=0
#---------------------- Flickr Images API Configuration -----------------------#
## If FLICKR_API_KEY is set, the web interface will try and display bird images
+1
View File
@@ -75,6 +75,7 @@ APPRISE_NOTIFICATION_TITLE="New BirdNET-Pi Detection"
APPRISE_NOTIFICATION_BODY="A \$sciname \$comname was just detected with a confidence of \$confidence"
APPRISE_NOTIFY_EACH_DETECTION=0
APPRISE_NOTIFY_NEW_SPECIES=0
APPRISE_WEEKLY_REPORT=0
#---------------------- Flickr Images API Configuration -----------------------#
## If FLICKR_API_KEY is set, the web interface will try and display bird images
+6
View File
@@ -111,6 +111,7 @@ create_necessary_dirs() {
sudo -u ${USER} ln -fs $my_dir/scripts/stats.php ${EXTRACTED}
sudo -u ${USER} ln -fs $my_dir/scripts/todays_detections.php ${EXTRACTED}
sudo -u ${USER} ln -fs $my_dir/scripts/history.php ${EXTRACTED}
sudo -u ${USER} ln -fs $my_dir/scripts/weekly_report.php ${EXTRACTED}
sudo -u ${USER} ln -fs $my_dir/homepage/images/favicon.ico ${EXTRACTED}
sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED}
sudo -u ${USER} ln -fs $my_dir/templates/phpsysinfo.ini ${HOME}/phpsysinfo/
@@ -406,6 +407,10 @@ install_cleanup_cron() {
sed "s/\$USER/$USER/g" $my_dir/templates/cleanup.cron >> /etc/crontab
}
install_weekly_cron() {
sed "s/\$USER/$USER/g" $my_dir/templates/weekly_report.cron >> /etc/crontab
}
chown_things() {
chown -R $USER:$USER $HOME/Bird*
}
@@ -431,6 +436,7 @@ install_services() {
install_phpsysinfo
install_livestream_service
install_cleanup_cron
install_weekly_cron
create_necessary_dirs
generate_BirdDB
+5
View File
@@ -95,6 +95,11 @@ if [[ "$pytest_installation_status" = "not installed" ]];then
fi
[ -L ~/BirdSongs/Extracted/weekly_report.php ] || ln -sf ~/BirdNET-Pi/scripts/weekly_report.php ~/BirdSongs/Extracted
[ -L /usr/local/bin/weekly_report.sh ] || ln -sf ~/BirdNET-Pi/scripts/weekly_report.php /usr/local/bin/weekly_report.sh
sed "s/\$USER/$USER/g" $HOME/BirdNET-Pi/templates/weekly_report.cron >> /etc/crontab
if ! grep APPRISE_WEEKLY_REPORT /etc/birdnet/birdnet.conf &>/dev/null;then
sudo -u$USER echo "APPRISE_WEEKLY_REPORT=0" >> /etc/birdnet/birdnet.conf
fi
sudo systemctl daemon-reload
restart_services.sh
@@ -1,4 +1,7 @@
#!/usr/bin/env bash
source /etc/birdnet/birdnet.conf
echo ${APPRISE_WEEKLY_REPORT}
NOTIFICATION=$(curl 'localhost/views.php?view=Weekly%20Report&ascii=true')
NOTIFICATION=${NOTIFICATION#*#}
firstLine=`echo "${NOTIFICATION}" | head -1`
+2
View File
@@ -0,0 +1,2 @@
#birdnet
0 7 * * 1 $USER /usr/local/bin/weekly_report.sh >/dev/null 2>&1