From b85afd8b281f5de7e956bf785c6ae2a8ccce1201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Schweizer?= Date: Wed, 20 Feb 2019 20:23:00 +0100 Subject: correct filename --- meetup/gen_dates2.sh | 76 ---------------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 meetup/gen_dates2.sh (limited to 'meetup/gen_dates2.sh') diff --git a/meetup/gen_dates2.sh b/meetup/gen_dates2.sh deleted file mode 100644 index 5b9160d..0000000 --- a/meetup/gen_dates2.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# generates the upcoming meetups for Funkfeuer Graz Homepage -# -# this script should be called by cron every day (night) -# how far in the future should i go? -LIMIT=3 - -# uncomment to enable debug -DEBUG=0 - -# where to put the output files? -NEXT_FILE="next.html" -AFTER_FILE="after.html" - -DOW=`date +"%u"` -if [ $DOW -eq 1 ]; then - DOM=`date +"%e"` - TS=`date +"%s"` -else - DOM=`date --date="next monday" +"%e"` - TS=`date --date="next monday" +"%s"` -fi - -MEETUPS="" -MEETUPTYPES="" -CNT=0 -while true; do - if [ -n "$DEBUG" ]; then echo -n "check day($TS): "`date --date="@$TS" +"%d.%m.%Y"`; fi - - if [ $DOM -le 7 ] || ([ $DOM -ge 15 ] && [ $DOM -le 21 ]); then - if [ $DOM -le 7 ]; then - MTYP="Tech/Core" - else - MTYP="gemütliches" - fi - if [ -n "$DEBUG" ]; then echo " -> ok $MTYP"; fi - MEETUPS="$MEETUPS $TS" - MEETUPTYPES="$MEETUPTYPES $MTYP" - CNT=$((CNT + 1)) - if [ $CNT -ge $LIMIT ]; then - break; - fi - else - if [ -n "$DEBUG" ]; then echo ""; fi - fi - TS=$((TS + (7 * 24 * 3600))) - DOM=`date --date="@$TS" +"%e"` -done - -set -- $MEETUPS -NEXT=$1 -shift -FUTURE=$@ - -set -- $MEETUPTYPES -NEXTMTYP=$1 -shift -FUTUREMTYP=$@ - -date --date="@$NEXT" +"%d.%m.%Y" > "$NEXT_FILE.new" -CNT=0 -echo "" >> "$AFTER_FILE.new" -mv "$NEXT_FILE.new" "$NEXT_FILE" -mv "$AFTER_FILE.new" "$AFTER_FILE" - -exit 0 -- cgit v1.2.1