scripts/fahrplan-import.sh: reimplement

This commit is contained in:
Astro 2017-10-19 22:20:23 +02:00
parent d2d031fc40
commit 6527805fb2
1 changed files with 15 additions and 19 deletions

View File

@ -1,23 +1,19 @@
#!/bin/sh
#!/usr/bin/env bash
# c3d2-web $ ./scripts/fahrplan-import.sh
set -e
set -x
cd ./content/static/datenspuren/2011/ || exit 1
CONF=DS2017
ROOT=$(dirname $0)/..
mkdir .tmp
cd .tmp
curl https://cccv.pentabarf.org/DS2011.tar.gz | tar xz
rm DS2011/style.css
IFS="
"
for f in $(find . -name \*.html)
do
sed -e 's/Computersicherheitsworkshop/Computer\­sicher\­heits\­work\­shop/g' \
-i "$f"
done
cp -r DS2011/* ../fahrplan/
cd ..
rm -r .tmp
git add ./fahrplan
git commit -m 'fahrplan import [auto]'
cd $ROOT/content/static/datenspuren/2017
curl -b "_another_frab_session=$FRAB_SESSION" \
https://frab.cccv.de/en/$CONF/schedule/download_static_export?export_locale=de \
> $CONF.tar.gz
tar xzf $CONF.tar.gz
rm $CONF.tar.gz
[ -d fahrplan/ ] && git rm -r fahrplan/
mv $CONF/ fahrplan/
git add fahrplan
git commit -m "ds17: fahrplan update"