From 14ce195179b360600b4c525cdd30d53904423de9 Mon Sep 17 00:00:00 2001 From: Alvin Schiller <103769832+AlvinSchiller@users.noreply.github.com> Date: Mon, 9 Oct 2023 00:57:13 +0200 Subject: [PATCH] change retrieval of current user (docker runs) --- .../installscripts/buster-install-default-with-autohotspot.sh | 4 ++-- scripts/installscripts/buster-install-default.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/installscripts/buster-install-default-with-autohotspot.sh b/scripts/installscripts/buster-install-default-with-autohotspot.sh index 863788965..0c535254b 100644 --- a/scripts/installscripts/buster-install-default-with-autohotspot.sh +++ b/scripts/installscripts/buster-install-default-with-autohotspot.sh @@ -28,8 +28,8 @@ DATETIME=$(date +"%Y%m%d_%H%M%S") SCRIPTNAME="$(basename $0)" JOB="${SCRIPTNAME}" -CURRENT_USER=$(logname) -HOME_DIR=$(getent passwd $CURRENT_USER | cut -d: -f6) +CURRENT_USER="${SUDO_USER:-$USER}" +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 7960c9053..d4788d3c3 100644 --- a/scripts/installscripts/buster-install-default.sh +++ b/scripts/installscripts/buster-install-default.sh @@ -28,8 +28,8 @@ DATETIME=$(date +"%Y%m%d_%H%M%S") SCRIPTNAME="$(basename $0)" JOB="${SCRIPTNAME}" -CURRENT_USER=$(logname) -HOME_DIR=$(getent passwd $CURRENT_USER | cut -d: -f6) +CURRENT_USER="${SUDO_USER:-$USER}" +HOME_DIR=$(getent passwd "$CURRENT_USER" | cut -d: -f6) JUKEBOX_HOME_DIR="${HOME_DIR}/RPi-Jukebox-RFID" LOGDIR="${HOME_DIR}"/phoniebox_logs