-
Notifications
You must be signed in to change notification settings - Fork 20
/
install.sh
executable file
·45 lines (35 loc) · 1.41 KB
/
install.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#! /usr/bin/env bash
##
## Installation script for GeoStat
## Alexey Nizhegolenko 2018
##
WORKDIR=$(pwd)
echo ""
echo "Creating virtual ENV and install all needed requirements..."
sleep 1
python3 -m venv venv && source venv/bin/activate
pip3 install -r requirements.txt && deactivate
echo ""
echo "Please edit settings.ini file and set the needed parameters..."
sleep 1
cp settings.ini.back settings.ini
"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini"
echo ""
echo "Installing GeoStat SystemD service..."
sleep 1
while read line
do
eval echo "$line"
done < "./geostat.service.template" > /lib/systemd/system/geostat.service
systemctl enable geostat.service
echo ""
echo "Last step, you need to register and download the lates GeoLite2 City mmdb file from the maxmind.com website"
echo "After you get an account on the maxmind.com you can find the needed file by the link below"
echo "https://www.maxmind.com/en/accounts/YOURACCOUNTID/geoip/downloads"
echo "Please don't forget to unzip and put the GeoLite2-City.mmdb file in the same directory with the geoparse.py"
echo "script, or you can put it enywhere and then fix the path in the settings.ini"
echo ""
echo "Good, all was done and you can start getting GEO data from your Nginx/Apache log file now"
echo "Please run 'systemctl start geostat.service' for starting the GeoStat script"
echo "You can find the GeoStat application logs in the syslog file if you need"
echo "Good Luck !"