From 826958cc24b15e314b59e6c9337d6db0c5662679 Mon Sep 17 00:00:00 2001 From: Jasper Wallace Date: Thu, 17 Apr 2014 01:04:34 +0000 Subject: [PATCH] don't spam us with email please --- getcards.sh | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/getcards.sh b/getcards.sh index 0776e8a..c4b320b 100755 --- a/getcards.sh +++ b/getcards.sh @@ -1,4 +1,28 @@ #!/bin/bash + +# +# XXX is this the best place to put these? +# +# symlink traversal attack? +# + cd /run/shm -curl -s -S -kf -o carddb.json.download --compressed https://london.hackspace.org.uk/carddb.php && mv carddb.json.download carddb.json +curl -s -S -kf -o carddb.json.download --compressed https://london.hackspace.org.uk/carddb.php > getcards.err 2>&1 + +if [ $? -eq 0 ] ; then + mv carddb.json.download carddb.json + if [ -e getcards.haderrors ] ; then + echo "doorbot is working now" + rm -f getcards.haderrors + fi +else + if [ ! -e getcards.haderrors ] ; then + echo "doorbot problems: " + echo + cat getcards.err ; rm -f getcards.err + echo ; echo "Further emails suppresed until getcards is working again" + touch getcards.haderrors + fi +fi + #curl -kf -o carddb.json.download --compressed https://85.119.83.146/carddb.php && mv carddb.json.download carddb.json