diff --git a/geoparser.service b/geostat.service.template similarity index 58% rename from geoparser.service rename to geostat.service.template index 3ba9b04..4a05964 100644 --- a/geoparser.service +++ b/geostat.service.template @@ -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 diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..5f9ed01 --- /dev/null +++ b/install.sh @@ -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"