Notification conf and cron setups
This commit is contained in:
@@ -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_NOTIFICATION_BODY="A \$sciname \$comname was just detected with a confidence of \$confidence"
|
||||||
APPRISE_NOTIFY_EACH_DETECTION=0
|
APPRISE_NOTIFY_EACH_DETECTION=0
|
||||||
APPRISE_NOTIFY_NEW_SPECIES=0
|
APPRISE_NOTIFY_NEW_SPECIES=0
|
||||||
|
APPRISE_WEEKLY_REPORT=0
|
||||||
|
|
||||||
#---------------------- Flickr Images API Configuration -----------------------#
|
#---------------------- Flickr Images API Configuration -----------------------#
|
||||||
## If FLICKR_API_KEY is set, the web interface will try and display bird images
|
## If FLICKR_API_KEY is set, the web interface will try and display bird images
|
||||||
|
|||||||
@@ -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_NOTIFICATION_BODY="A \$sciname \$comname was just detected with a confidence of \$confidence"
|
||||||
APPRISE_NOTIFY_EACH_DETECTION=0
|
APPRISE_NOTIFY_EACH_DETECTION=0
|
||||||
APPRISE_NOTIFY_NEW_SPECIES=0
|
APPRISE_NOTIFY_NEW_SPECIES=0
|
||||||
|
APPRISE_WEEKLY_REPORT=0
|
||||||
|
|
||||||
#---------------------- Flickr Images API Configuration -----------------------#
|
#---------------------- Flickr Images API Configuration -----------------------#
|
||||||
## If FLICKR_API_KEY is set, the web interface will try and display bird images
|
## If FLICKR_API_KEY is set, the web interface will try and display bird images
|
||||||
|
|||||||
@@ -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/stats.php ${EXTRACTED}
|
||||||
sudo -u ${USER} ln -fs $my_dir/scripts/todays_detections.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/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 $my_dir/homepage/images/favicon.ico ${EXTRACTED}
|
||||||
sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED}
|
sudo -u ${USER} ln -fs ${HOME}/phpsysinfo ${EXTRACTED}
|
||||||
sudo -u ${USER} ln -fs $my_dir/templates/phpsysinfo.ini ${HOME}/phpsysinfo/
|
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
|
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_things() {
|
||||||
chown -R $USER:$USER $HOME/Bird*
|
chown -R $USER:$USER $HOME/Bird*
|
||||||
}
|
}
|
||||||
@@ -431,6 +436,7 @@ install_services() {
|
|||||||
install_phpsysinfo
|
install_phpsysinfo
|
||||||
install_livestream_service
|
install_livestream_service
|
||||||
install_cleanup_cron
|
install_cleanup_cron
|
||||||
|
install_weekly_cron
|
||||||
|
|
||||||
create_necessary_dirs
|
create_necessary_dirs
|
||||||
generate_BirdDB
|
generate_BirdDB
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ if [[ "$pytest_installation_status" = "not installed" ]];then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[ -L ~/BirdSongs/Extracted/weekly_report.php ] || ln -sf ~/BirdNET-Pi/scripts/weekly_report.php ~/BirdSongs/Extracted
|
[ -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
|
sudo systemctl daemon-reload
|
||||||
restart_services.sh
|
restart_services.sh
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
source /etc/birdnet/birdnet.conf
|
||||||
|
echo ${APPRISE_WEEKLY_REPORT}
|
||||||
|
|
||||||
NOTIFICATION=$(curl 'localhost/views.php?view=Weekly%20Report&ascii=true')
|
NOTIFICATION=$(curl 'localhost/views.php?view=Weekly%20Report&ascii=true')
|
||||||
NOTIFICATION=${NOTIFICATION#*#}
|
NOTIFICATION=${NOTIFICATION#*#}
|
||||||
firstLine=`echo "${NOTIFICATION}" | head -1`
|
firstLine=`echo "${NOTIFICATION}" | head -1`
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
#birdnet
|
||||||
|
0 7 * * 1 $USER /usr/local/bin/weekly_report.sh >/dev/null 2>&1
|
||||||
Reference in New Issue
Block a user