From 57d3179dec07567ac929b353b25740663cbf65bd Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Mon, 9 Oct 2023 00:18:09 +0200 Subject: [PATCH] get the correct homedir even if called with sudo --- .../installscripts/buster-install-default-with-autohotspot.sh | 2 +- scripts/installscripts/buster-install-default.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/installscripts/buster-install-default-with-autohotspot.sh b/scripts/installscripts/buster-install-default-with-autohotspot.sh index e6f3411d3..863788965 100644 --- a/scripts/installscripts/buster-install-default-with-autohotspot.sh +++ b/scripts/installscripts/buster-install-default-with-autohotspot.sh @@ -29,7 +29,7 @@ SCRIPTNAME="$(basename $0)" JOB="${SCRIPTNAME}" CURRENT_USER=$(logname) -HOME_DIR=$(echo $HOME) +HOME_DIR=$(getent passwd $CURRENT_USER | cut -d: -f6) JUKEBOX_HOME_DIR="${HOME_DIR}/RPi-Jukebox-RFID" LOGDIR="${HOME_DIR}"/phoniebox_logs diff --git a/scripts/installscripts/buster-install-default.sh b/scripts/installscripts/buster-install-default.sh index d18cfba2c..7960c9053 100644 --- a/scripts/installscripts/buster-install-default.sh +++ b/scripts/installscripts/buster-install-default.sh @@ -29,7 +29,7 @@ SCRIPTNAME="$(basename $0)" JOB="${SCRIPTNAME}" CURRENT_USER=$(logname) -HOME_DIR=$(echo $HOME) +HOME_DIR=$(getent passwd $CURRENT_USER | cut -d: -f6) JUKEBOX_HOME_DIR="${HOME_DIR}/RPi-Jukebox-RFID" LOGDIR="${HOME_DIR}"/phoniebox_logs