-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
28 lines (26 loc) · 994 Bytes
/
install.sh
File metadata and controls
28 lines (26 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
readonly ROCKETCHATCTL_DOWNLOAD_URL="https://raw.githubusercontent.com/RocketChat/install.sh/master/rocketchatctl"
readonly ROCKETCHATCTL_DIRECTORY="/usr/local/bin"
if [ ${EUID} -ne 0 ]; then
echo "This script must be run as root. Cancelling" >&2
exit 1
fi
if ! [[ -t 0 ]]; then
echo "This script is interactive, please run: bash -c \"\$(curl https://rocket.chat/install.sh)\"" >&2
exit 1
fi
if [ ! -f "$ROCKETCHATCTL_DIRECTORY/rocketchatctl" ]; then
curl -L $ROCKETCHATCTL_DOWNLOAD_URL -o /tmp/rocketchatctl
if [ $? != 0 ]; then
echo "Error downloading rocketchatctl."
exit 1
else
mv /tmp/rocketchatctl $ROCKETCHATCTL_DIRECTORY/
chmod 755 $ROCKETCHATCTL_DIRECTORY/rocketchatctl
fi
$ROCKETCHATCTL_DIRECTORY/rocketchatctl install $@
else
echo "You already have rocketchatctl installed, use rocketchatctl to manage your RocketChat installation."
echo "Run rocketchatctl help for more info."
exit 1
fi