Add default for USER when unset

uses $(id -u -n) when USER is unset, this is needed on some weird
setups in Docker. Fixes #971
This commit is contained in:
Matthew Bauer 2019-07-25 09:39:44 -04:00
parent b640f69a4d
commit c82a856b36

View file

@ -12,7 +12,7 @@ if ! [ -e "$self/.reginfo" ]; then
echo "$0: incomplete installer (.reginfo is missing)" >&2
fi
if [ -z "$USER" ]; then
if [ -z "$USER" ] && ! USER=$(id -u -n); then
echo "$0: \$USER is not set" >&2
exit 1
fi