Skip to content

A live bird collage card for your Home Assistant dashboard.

Update update_birdnet.sh

Patrick McGuired3d1dbcd07cf
diff --git a/scripts/update_birdnet.sh b/scripts/update_birdnet.sh
index 50e74bfe..0b82e319 100755
--- a/scripts/update_birdnet.sh
+++ b/scripts/update_birdnet.sh
@@ -5,6 +5,10 @@ trap 'exit 1' SIGINT SIGHUP
usage() { echo "Usage: $0 [-r <remote name>] [-b <branch name>]" 1>&2; exit 1; }
+USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
+HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
+my_dir=$HOME/BirdNET-Pi/scripts
+
# Defaults
remote="origin"
branch="main"
@@ -31,11 +35,6 @@ while getopts ":r:b:" o; do
done
shift $((OPTIND-1))
-USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
-HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
-my_dir=$HOME/BirdNET-Pi/scripts
-
-
sudo_with_user () {
set -x
sudo -u $USER "$@"