Show error if "server" is run non-root.

This commit is contained in:
Scott Duensing 2023-01-18 20:56:51 -06:00
parent d861b38bba
commit 8b860ab407

View file

@ -291,6 +291,10 @@ function startup() {
# We're running as root, so use specified G_EHOME.
G_EHOME="$(getent passwd ${2} | cut -d: -f6)"
else
if [[ "${ACTION}" == "server" ]]; then
echo "The \"server\" option must be run as root."
exit 1
fi
# Not root, use standard G_EHOME.
G_EHOME="$(getent passwd ${USER} | cut -d: -f6)"
fi