geostat/install.sh
Alexey Nizhegolenko 8f8074692a
Update install.sh
2018-10-10 22:17:03 +03:00

41 lines
943 B
Bash
Executable file

#! /usr/bin/env bash
##
## Installation script for GeoStat
## Alexey Nizhegolenko 2018
##
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
echo ""
echo "Creating virtual ENV and installing requirements..."
sleep 1
virtualenv venv && source venv/bin/activate
pip install -r requirements.txt && deactivate
echo ""
echo "Please edit settings.ini file and set right parameters..."
sleep 1
cp settings.ini.back settings.ini
"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini"
echo ""
echo "Installing 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 "All done, now you can start getting GEO data from your log"
echo "run 'systemctl start geostat.service' for this"
echo "Good Luck !"