From 2d2b2ba459624f64a6a3fe3bcc6f8ffc8021d6c4 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 3 May 2024 10:52:35 +0200 Subject: [PATCH] Update changeidenfication.sh --- birdnet-pi/rootfs/helpers/changeidenfication.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/birdnet-pi/rootfs/helpers/changeidenfication.sh b/birdnet-pi/rootfs/helpers/changeidenfication.sh index 7de752267..34918ce1a 100755 --- a/birdnet-pi/rootfs/helpers/changeidenfication.sh +++ b/birdnet-pi/rootfs/helpers/changeidenfication.sh @@ -23,6 +23,11 @@ DETECTIONS_TABLE="detections" # VALIDITY CHECKS # ################### +# Check if files exist +if [ ! -d "$LABELS_FILE" ]; then echo "$LABELS_FILE doesn't exist, exiting" && exit 1; fi +if [ ! -d "$DB_FILE" ]; then echo "$DB_FILE doesn't exist, exiting" && exit 1; fi + +# Check if inputs are valid if [[ "$1" != *".mp3" ]]; then echo "The first argument should be a filename starting with the common name of the bird and finishing by mp3!" echo "Instead, it is : $1"