2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-10-02 00:47:38 +02:00
|
|
|
#
|
|
|
|
# Thin wrapper around the actual install script (scripts/lib/install).
|
|
|
|
# The purpose of this wrapper is to log the full install script output
|
|
|
|
# to /var/log/zulip/install.log for easy debugging.
|
|
|
|
|
2015-10-07 06:57:40 +02:00
|
|
|
set -e
|
2015-09-27 15:02:45 +02:00
|
|
|
if [ "$EUID" -ne 0 ]; then
|
2021-06-23 17:42:46 +02:00
|
|
|
echo "Error: The installation script must be run as root." >&2
|
2015-09-27 15:02:45 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
2017-03-26 00:41:09 +01:00
|
|
|
umask 022
|
2015-08-28 18:40:30 +02:00
|
|
|
mkdir -p /var/log/zulip
|
2016-08-01 00:30:42 +02:00
|
|
|
|
2015-09-26 03:47:30 +02:00
|
|
|
"$(dirname "$(dirname "$0")")/lib/install" "$@" 2>&1 | tee -a /var/log/zulip/install.log
|
2016-08-01 00:30:42 +02:00
|
|
|
failed=${PIPESTATUS[0]}
|
|
|
|
|
2019-07-19 03:36:59 +02:00
|
|
|
if [ "$failed" -ne 0 ]; then
|
2018-08-03 02:14:47 +02:00
|
|
|
echo -e '\033[0;31m'
|
2019-07-19 03:36:59 +02:00
|
|
|
echo "Zulip installation failed (exit code $failed)!"
|
2016-08-01 00:30:42 +02:00
|
|
|
echo
|
|
|
|
echo -n "The install process is designed to be idempotent, so you can retry "
|
|
|
|
echo -n "after resolving whatever issue caused the failure (there should be a traceback above). "
|
|
|
|
echo -n "A log of this installation is available in /var/log/zulip/install.log"
|
2018-08-03 02:14:47 +02:00
|
|
|
echo -e '\033[0m'
|
2019-07-19 03:36:59 +02:00
|
|
|
exit "$failed"
|
2016-08-01 00:30:42 +02:00
|
|
|
fi
|