#!/bin/sh # requires: wget git set -euf NOW=$(date -I) OUTDIR=${OUTDIR:-$PWD} DATADIR=${DATADIR:-$OUTDIR/db} PDFDIR=${PDFDIR:-$OUTDIR/pdf} # old: thyssenkruppsystemengineering # empty: metabo-nuertingen mkdir -p $DATADIR $PDFDIR for i in thales-deutschland ibm-boeblingen buerocampus-wangen continental-villingen;do db=$DATADIR/$i.json arafetch --db $db --cantine $i ara2influx $db --cantine $i db=$PDFDIR/$i-$NOW.pdf wget https://gast.aramark.de/$i/menu/pdf/woche_de.php -O $db || echo "Unable to fetch pdf plan of $i" done # commit changes pushd $DATADIR if ! test -e .git;then echo "initializing git repo for $DATADIR" git init git config user.email "arafetch@localhost" git config user.name "arafetch daemon" fi git add -A git commit -m "update $NOW" popd