added install.sh and changed some file names

This commit is contained in:
Alexey 2018-10-10 09:46:09 +03:00
parent 267a40e30e
commit ea19615599
2 changed files with 29 additions and 4 deletions

View file

@ -1,14 +1,13 @@
***GeoStat.service***
[Unit]
Description=GeoStat
After=network.target
StartLimitIntervalSec=0
[Service]
Type=simple
ExecStart=/opt/geostat/venv/bin/python geoparser.py
ExecStart=$PWD/venv/bin/python geoparser.py
User=root
WorkingDirectory=/opt/geostat
WorkingDirectory=$PWD
Restart=always
RestartSec=2

26
install.sh Executable file
View file

@ -0,0 +1,26 @@
#! /usr/bin/env bash
##
## Installetion for GeoStat script
##
echo "Creating virtual ENV and installing requirements..."
virtualenv venv && source venv/bin/activate
pip install -r requirements.txt
cp settings.ini.back settings.ini
"${VISUAL:-"${EDITOR:-vi}"}" "settings.ini"
while read line
do
eval echo "$line"
done < "./geostat.service.template" > /lib/systemd/system/geostat.service
systemctl enable geostat.service
echo "All done, now you can start getting GEO data from your log"
echo "run 'systemd start geostat.service' "
echo "Good Luck"