From ba7e5daf001dbb01d7fa605dfb5547d225e1181d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 3 May 2024 10:50:43 +0200 Subject: [PATCH] Allow user inputs --- birdnet-pi/rootfs/helpers/changeidenfication.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/birdnet-pi/rootfs/helpers/changeidenfication.sh b/birdnet-pi/rootfs/helpers/changeidenfication.sh index 68a6a5109..7de752267 100755 --- a/birdnet-pi/rootfs/helpers/changeidenfication.sh +++ b/birdnet-pi/rootfs/helpers/changeidenfication.sh @@ -10,6 +10,10 @@ OLDNAME="$1" #OLDNAME="Mésange_charbonnière-78-2024-05-02-birdnet-RTSP_1-18:14:08.mp3" NEWNAME="$2" #NEWNAME="Lapinus atricapilla_Lapinu à tête noire" +# Ask for user input if no arguments +if [ -z "$OLDNAME" ]; then read -p 'OLDNAME (finishing my mp3): ' OLDNAME; fi +if [ -z "$NEWNAME" ]; then read -p 'NEWNAME (sciname_commoname": ' NEWNAME; fi + # Fixed values LABELS_FILE="$HOME/BirdNET-Pi/model/labels.txt" DB_FILE="$HOME/BirdNET-Pi/scripts/birds.db" @@ -19,7 +23,6 @@ DETECTIONS_TABLE="detections" # VALIDITY CHECKS # ################### -# Check if arguments 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"