Update update_birdnet.sh

This commit is contained in:
Patrick McGuire
2022-06-01 12:33:38 -04:00
committed by GitHub
parent d218df1fa7
commit d3d1dbcd07
+4 -5
View File
@@ -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 "$@"