view mkalloyinfo.sh @ 16:1a7f8f8cd5ff

No need to transfer these files around anymore.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 05 Jan 2016 07:57:33 +0200
parents c4f3b5b88891
children
line wrap: on
line source

#!/bin/sh
ADDR="ccr@tnsp.org:/var/www/tnsp.org/mat/"
DESTDIR="./"
ALLOYPHP="${DESTDIR}/alloys.inc.php"
ALLOYTXT="${DESTDIR}/alloys.txt"

echo "Generating alloy data ..."
cat logs/*/*.log | \
grep -B1 "^You mix .* and create a quantity of " >> tmp

perl -w parsealloys.pl -php < tmp > "$ALLOYPHP"
perl -w parsealloys.pl -text < tmp > "$ALLOYTXT"

rm -f tmp

echo "Uploading ..."
scp -C "$ALLOYTXT" "$ALLOYPHP" "$ADDR"