config: BIRDNET_USER=$USER added
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
# so far.
|
# so far.
|
||||||
set -x
|
set -x
|
||||||
source /etc/birdnet/birdnet.conf
|
source /etc/birdnet/birdnet.conf
|
||||||
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
|
USER=${BIRDNET_USER}
|
||||||
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
HOME=/home/${BIRDNET_USER}
|
||||||
my_dir=${HOME}/BirdNET-Pi/scripts
|
my_dir=${HOME}/BirdNET-Pi/scripts
|
||||||
echo "Stopping services"
|
echo "Stopping services"
|
||||||
sudo systemctl stop birdnet_recording.service
|
sudo systemctl stop birdnet_recording.service
|
||||||
|
|||||||
@@ -121,6 +121,11 @@ FLICKR_FILTER_EMAIL=
|
|||||||
#-------------------------------- Defaults ----------------------------------#
|
#-------------------------------- Defaults ----------------------------------#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
## BIRDNET_USER is for scripts to easily find where BirdNET-Pi is installed
|
||||||
|
## DO NOT EDIT!
|
||||||
|
|
||||||
|
BIRDNET_USER=$USER
|
||||||
|
|
||||||
## RECS_DIR is the location birdnet_analysis.service will look for the data-set
|
## RECS_DIR is the location birdnet_analysis.service will look for the data-set
|
||||||
## it needs to analyze. Be sure this directory is readable and writable for
|
## it needs to analyze. Be sure this directory is readable and writable for
|
||||||
## the BIRDNET_USER.
|
## the BIRDNET_USER.
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ while getopts "l:" o; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
source /etc/birdnet/birdnet.conf
|
||||||
|
HOME=/home/${BIRDNET_USER}
|
||||||
|
|
||||||
label_file_name="labels_${lang}.txt"
|
label_file_name="labels_${lang}.txt"
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ while getopts "l:" o; do
|
|||||||
done
|
done
|
||||||
shift $((OPTIND-1))
|
shift $((OPTIND-1))
|
||||||
|
|
||||||
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
source /etc/birdnet/birdnet.conf
|
||||||
|
HOME=/home/${BIRDNET_USER}
|
||||||
|
|
||||||
label_file_name="labels_${lang}.txt"
|
label_file_name="labels_${lang}.txt"
|
||||||
|
|
||||||
|
|||||||
@@ -5,8 +5,13 @@ trap 'exit 1' SIGINT SIGHUP
|
|||||||
|
|
||||||
usage() { echo "Usage: $0 [-r <remote name>] [-b <branch name>]" 1>&2; exit 1; }
|
usage() { echo "Usage: $0 [-r <remote name>] [-b <branch name>]" 1>&2; exit 1; }
|
||||||
|
|
||||||
|
if [ -n "${BIRDNET_USER}" ]; then
|
||||||
|
USER=${BIRDNET_USER}
|
||||||
|
HOME=/home/${BIRDNET_USER}
|
||||||
|
else
|
||||||
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
|
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
|
||||||
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
||||||
|
fi
|
||||||
my_dir=$HOME/BirdNET-Pi/scripts
|
my_dir=$HOME/BirdNET-Pi/scripts
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
|
|||||||
@@ -2,10 +2,15 @@
|
|||||||
set -x
|
set -x
|
||||||
# Update BirdNET-Pi
|
# Update BirdNET-Pi
|
||||||
trap 'exit 1' SIGINT SIGHUP
|
trap 'exit 1' SIGINT SIGHUP
|
||||||
|
source /etc/birdnet/birdnet.conf
|
||||||
|
if [ -n "${BIRDNET_USER}" ]; then
|
||||||
|
USER=${BIRDNET_USER}
|
||||||
|
HOME=/home/${BIRDNET_USER}
|
||||||
|
else
|
||||||
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
|
USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)
|
||||||
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
HOME=$(awk -F: '/1000/ {print $6}' /etc/passwd)
|
||||||
|
fi
|
||||||
my_dir=$HOME/BirdNET-Pi/scripts
|
my_dir=$HOME/BirdNET-Pi/scripts
|
||||||
source /etc/birdnet/birdnet.conf
|
|
||||||
source "$my_dir/install_helpers.sh"
|
source "$my_dir/install_helpers.sh"
|
||||||
|
|
||||||
# Sets proper permissions and ownership
|
# Sets proper permissions and ownership
|
||||||
@@ -65,6 +70,12 @@ if ! grep -E '^DATA_MODEL_VERSION=' /etc/birdnet/birdnet.conf &>/dev/null;then
|
|||||||
echo "DATA_MODEL_VERSION=1" >> /etc/birdnet/birdnet.conf
|
echo "DATA_MODEL_VERSION=1" >> /etc/birdnet/birdnet.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if ! grep -E '^BIRDNET_USER=' /etc/birdnet/birdnet.conf &>/dev/null;then
|
||||||
|
echo "## BIRDNET_USER is for scripts to easily find where BirdNET-Pi is installed" >> /etc/birdnet/birdnet.conf
|
||||||
|
echo "## DO NOT EDIT!" >> /etc/birdnet/birdnet.conf
|
||||||
|
echo "BIRDNET_USER=$(awk -F: '/1000/ {print $1}' /etc/passwd)" >> /etc/birdnet/birdnet.conf
|
||||||
|
fi
|
||||||
|
|
||||||
if ! grep -E '^RTSP_STREAM_TO_LIVESTREAM=' /etc/birdnet/birdnet.conf &>/dev/null;then
|
if ! grep -E '^RTSP_STREAM_TO_LIVESTREAM=' /etc/birdnet/birdnet.conf &>/dev/null;then
|
||||||
echo "RTSP_STREAM_TO_LIVESTREAM=\"0\"" >> /etc/birdnet/birdnet.conf
|
echo "RTSP_STREAM_TO_LIVESTREAM=\"0\"" >> /etc/birdnet/birdnet.conf
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user