diff --git a/carburants.service b/carburants.service new file mode 100644 index 0000000..a9319d8 --- /dev/null +++ b/carburants.service @@ -0,0 +1,18 @@ +[Unit] +Description=API Carburants! +After=network-online.target + +[Service] +Environment="PORT=3666" +Type=simple +User=dbroqua +Group=dbroqua +UMask=007 +WorkingDirectory=/home/dbroqua/carburants/api +ExecStart=yarn start +Restart=on-failure +TimeoutStopSec=300 + +[Install] +WantedBy=multi-user.target + diff --git a/cron.sh b/cron.sh new file mode 100755 index 0000000..a81e342 --- /dev/null +++ b/cron.sh @@ -0,0 +1,16 @@ +#! /bin/bash + +SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" + +cd ${SCRIPTPATH} +mkdir ./public +cd ./public +wget https://donnees.roulez-eco.fr/opendata/jour +unzip jour +mv PrixCarburants_quotidien*.xml gas-stations.xml +rm jour + +cd ../ + +node importGasStations.js +