2018-10-10 08:46:09 +02:00
|
|
|
#! /usr/bin/env bash
|
|
|
|
|
|
|
|
##
|
2018-10-10 09:30:56 +02:00
|
|
|
## Installetion script for GeoStat
|
|
|
|
## Alexey Nizhegolenko 2018
|
2018-10-10 08:46:09 +02:00
|
|
|
##
|
2018-10-10 20:48:48 +02:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Downloading latest GeoLiteCity.dat from MaxMind"
|
|
|
|
sleep 1
|
|
|
|
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz
|
|
|
|
gunzip GeoLiteCity.dat.gz
|
|
|
|
|
2018-10-10 09:56:13 +02:00
|
|
|
echo ""
|
2018-10-10 08:46:09 +02:00
|
|
|
echo "Creating virtual ENV and installing requirements..."
|
2018-10-10 09:30:56 +02:00
|
|
|
sleep 1
|
2018-10-10 09:56:13 +02:00
|
|
|
virtualenv venv && source venv/bin/activate
|
2018-10-10 08:46:09 +02:00
|
|
|
|
2018-10-10 09:30:56 +02:00
|
|
|
pip install -r requirements.txt && deactivate
|
2018-10-10 08:46:09 +02:00
|
|
|
|
2018-10-10 09:56:13 +02:00
|
|
|
echo ""
|
2018-10-10 09:30:56 +02:00
|
|
|
echo "Please edit settings.ini file and set right parameters..."
|
2018-10-10 09:56:13 +02:00
|
|
|
sleep 1
|
2018-10-10 08:46:09 +02:00
|
|
|
cp settings.ini.back settings.ini
|
|
|
|
|
|
|
|
"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini"
|
|
|
|
|
2018-10-10 09:56:13 +02:00
|
|
|
echo ""
|
2018-10-10 09:30:56 +02:00
|
|
|
echo "Installing SystemD service..."
|
2018-10-10 09:56:13 +02:00
|
|
|
sleep 1
|
2018-10-10 08:46:09 +02:00
|
|
|
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 ""
|
2018-10-10 08:46:09 +02:00
|
|
|
echo "All done, now you can start getting GEO data from your log"
|
2018-10-10 09:56:13 +02:00
|
|
|
echo "run 'systemctl start geostat.service' for this"
|
2018-10-10 09:30:56 +02:00
|
|
|
echo "Good Luck !"
|