Skip to content

Commit ebad72f

Browse files
committed
add path check since we handle installation by countly user now
1 parent a020aa6 commit ebad72f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

bin/countly.install.sh

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,16 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
33
DATE=$(date +%Y-%m-%d:%H:%M:%S)
44
totalm=$(free -m | awk '/^Mem:/{print $2}')
55

6+
if [[ "$DIR" = '/root'* ]]; then
7+
echo "You cannot install Countly under /root. Suggested paths: /opt or /usr."
8+
exit 1
9+
elif [[ "$DIR" = '/home'* ]]; then
10+
if ! [[ "$DIR" = '/home/countly'* ]]; then
11+
echo "You cannot install Countly under home directory of any other user. Suggested paths: /opt or /usr."
12+
exit 1
13+
fi
14+
fi
15+
616
if [ "$INSIDE_DOCKER" == "1" ]; then
717
if [ -f /etc/lsb-release ]; then
818
apt install sudo -y

0 commit comments

Comments
 (0)