mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-01 11:46:07 +02:00
Update 30-monitoring.sh
This commit is contained in:
@@ -1,17 +1,13 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
# Adapted from https://github.com/mcguirepr89/BirdNET-Pi/issues/393#issuecomment-1166445710
|
|
||||||
|
|
||||||
# Define logging functions
|
# Define logging functions
|
||||||
log_green() { echo -e "\033[32m$1\033[0m" }
|
log_green() { echo -e "\033[32m$1\033[0m"; }
|
||||||
|
log_red() { echo -e "\033[31m$1\033[0m"; }
|
||||||
|
log_yellow() { echo -e "\033[33m$1\033[0m"; }
|
||||||
|
log_info() { echo -e "\033[34m$1\033[0m"; }
|
||||||
|
|
||||||
log_red() { echo -e "\033[31m$1\033[0m" }
|
log_green "Starting service: throttlerecording"
|
||||||
|
|
||||||
log_yellow() { echo -e "\033[33m$1\033[0m" }
|
|
||||||
|
|
||||||
log_info() { echo -e "\033[34m$1\033[0m" }
|
|
||||||
|
|
||||||
echo "$(log_green "Starting service: throttlerecording")"
|
|
||||||
touch "$HOME/BirdSongs/StreamData/analyzing_now.txt"
|
touch "$HOME/BirdSongs/StreamData/analyzing_now.txt"
|
||||||
|
|
||||||
# Read configuration
|
# Read configuration
|
||||||
@@ -24,9 +20,7 @@ ingest_dir="$RECS_DIR/StreamData"
|
|||||||
counter=10
|
counter=10
|
||||||
|
|
||||||
# Ensure directories and permissions
|
# Ensure directories and permissions
|
||||||
mkdir -p "$ingest_dir"
|
mkdir -p "$ingest_dir" && chown -R pi:pi "$ingest_dir" && chmod -R 755 "$ingest_dir"
|
||||||
chown -R pi:pi "$ingest_dir"
|
|
||||||
chmod -R 755 "$ingest_dir"
|
|
||||||
|
|
||||||
# Function to send notifications using Apprise
|
# Function to send notifications using Apprise
|
||||||
apprisealert() {
|
apprisealert() {
|
||||||
|
|||||||
Reference in New Issue
Block a user