install: Verify that the script has sufficient privileges.

This commit is contained in:
Ged Lawrenson 2015-09-27 14:02:45 +01:00 committed by Tim Abbott
parent bec3c0943a
commit 21b7048e54
1 changed files with 4 additions and 0 deletions

View File

@ -1,3 +1,7 @@
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "Error: The installation script must be run as root" >&2
exit 1
fi
mkdir -p /var/log/zulip
"$(dirname "$(dirname "$0")")/lib/install" "$@" 2>&1 | tee -a /var/log/zulip/install.log