From 59088716336375dcc08387b8cf7ff179e495d57a Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 26 Jul 2018 16:46:57 -0600 Subject: [PATCH] use 'who am i' rather than 'logname' --- usr/share/install_helper.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr/share/install_helper.sh b/usr/share/install_helper.sh index dc30b7a..af3d2cf 100644 --- a/usr/share/install_helper.sh +++ b/usr/share/install_helper.sh @@ -34,7 +34,10 @@ set -u TELEBIT_DEBUG=${TELEBIT_DEBUG:-} # NOTE: On OS X logname works from a pipe, but on Linux it does not -if [ -n "$(logname 2>/dev/null | grep '.')" ] && [ "$(logname)" != "$(id -u -n)" ]; then +my_logname=$(who am i | awk '{print $1}') +#my_logname=${my_logname:-$(logname)} +#my_logname=${my_logname:-$SUDO_USER} +if [ -n "$my_logname" ] && [ "$my_logname" != "$(id -u -n)" ]; then echo "WARNING:" echo " You are logged in as '$(logname)' but acting as '$(id -u -n)'." echo " If the installation is not successful please log in as '$(id -u -n)' directly."