From 33d8251a8d990d22dd1cca13b4f0bc61f0517b15 Mon Sep 17 00:00:00 2001 From: LordGrey <48840279+Lord-Grey@users.noreply.github.com> Date: Sun, 19 Nov 2023 20:33:54 +0100 Subject: [PATCH] Use SUDO_USER in postinst --- cmake/package-scripts/postinst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/package-scripts/postinst b/cmake/package-scripts/postinst index f5aba661..88d2e12a 100644 --- a/cmake/package-scripts/postinst +++ b/cmake/package-scripts/postinst @@ -47,7 +47,7 @@ if [ "$IS_UPGRADE" = false ]; then then # systemd echo "---> init deamon: systemd" - FOUND_USR=$(who | grep -o -m1 '^\w*\b' || echo "root") + FOUND_USR=${SUDO_USER:-root} install_file /usr/share/hyperion/service/hyperion.systemd /etc/systemd/system/hyperion@.service systemctl enable hyperion"@${FOUND_USR}".service START_MSG="--> systemctl start hyperion for user ${FOUND_USR}"