geostat/install.sh

46 lines
1.4 KiB
Bash
Raw Normal View History

#! /usr/bin/env bash
##
2018-10-10 21:17:03 +02:00
## Installation script for GeoStat
2018-10-10 09:30:56 +02:00
## Alexey Nizhegolenko 2018
##
2018-10-10 20:48:48 +02:00
WORKDIR=$(pwd)
2018-10-10 20:48:48 +02:00
echo ""
echo "Creating virtual ENV and install all needed requirements..."
2018-10-10 20:48:48 +02:00
sleep 1
python3 -m venv venv && source venv/bin/activate
2018-10-10 20:48:48 +02:00
pip3 install -r requirements.txt && deactivate
2018-10-10 09:56:13 +02:00
echo ""
echo "Please edit settings.ini file and set the needed parameters..."
2018-10-10 09:56:13 +02:00
sleep 1
cp settings.ini.back settings.ini
"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini"
2018-10-10 09:56:13 +02:00
echo ""
echo "Installing GeoStat SystemD service..."
2018-10-10 09:56:13 +02:00
sleep 1
while read line
do
eval echo "$line"
done < "./geostat.service.template" > /lib/systemd/system/geostat.service
systemctl enable geostat.service
2018-10-10 09:56:13 +02:00
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"
2018-10-10 09:30:56 +02:00
echo "Good Luck !"