ignore bad logname on some linuxes

This commit is contained in:
AJ ONeal 2018-07-26 16:35:04 -06:00
parent 515d74a1ea
commit aaa11c4c87
1 changed files with 2 additions and 1 deletions

View File

@ -33,7 +33,8 @@ set -u
TELEBIT_DEBUG=${TELEBIT_DEBUG:-}
if [ "$(logname)" != "$(id -u -n)" ]; then
# 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
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."