moved includes and cleaned up paths

This commit is contained in:
root 2018-05-17 16:11:27 +02:00
parent 1490a96f14
commit e7525fda56
45 changed files with 15 additions and 10 deletions

View file

@ -1,17 +1,21 @@
#! /bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
CHCH_ICAL_SRC="https://cloud.chch.it/remote.php/dav/public-calendars/KVJE5OXYIY9B9V5C?export"
CHCH_ICAL="/var/www/chch_api/chch.ical"
WIKI_PATH="/var/www/chch/"
RAND="$(date +%s)$RANDOM$RANDOM$RANDOM"
CHCH_ICAL_TMP="/tmp/chch_$RAND.ical"
rm -rf /tmp/chch_*.ical
wget "$CHCH_ICAL_SRC" -O /tmp/chch_$RAND.ical -q -T 45
wget "$CHCH_ICAL_SRC" -O "$CHCH_ICAL_TMP" -q -T 45
if [ $? -ne 0 ]; then
echo "ERROR: wget failed to download calendar" >&2
else
mv /tmp/chch_$RAND.ical $CHCH_ICAL
mv "$CHCH_ICAL_TMP" "$CHCH_ICAL"
fi
# this requires -> icalparser from https://github.com/OzzyCzech/icalparser.git
head $CHCH_ICAL -n1 >/dev/null 2>&1 && php /etc/chch/chch_ical2mediawiki.php $CHCH_ICAL 2>/dev/null | php /var/www/chch/maintenance/edit.php -m -b --no-rc -s "automatische Aktualisierung aus dem ical feed" "Aktuelle_ChCh-Termine" >/dev/null 2>&1
echo "Hauptseite" | php /var/www/chch/maintenance/purgeList.php --purge > /dev/null 2>&1
head $CHCH_ICAL -n1 >/dev/null 2>&1 && php "$SCRIPT_DIR/include/chch_ical2mediawiki.php" "$CHCH_ICAL" 2>/dev/null | php "$WIKI_PATH/maintenance/edit.php" -m -b --no-rc -s "automatische Aktualisierung aus dem ical feed" "Aktuelle_ChCh-Termine" >/dev/null 2>&1
echo "Hauptseite" | php "$WIKI_PATH/maintenance/purgeList.php" --purge > /dev/null 2>&1