Files
i2p.www/site-updater.sh

22 lines
588 B
Bash
Raw Normal View History

#!/bin/sh -x
cd $(dirname $0)
2013-12-08 20:16:46 +00:00
. ./etc/update.vars
[ -f ./etc/update.vars.custom ] && . ./etc/update.vars.custom
2013-12-08 20:16:46 +00:00
TMP=$(mktemp XXXXXXXXXX)
trap 'rm -f $TMP;exit' 0 1 2 15
2013-08-14 22:18:06 +00:00
$MTN pull "mtn://$MTNURL?$MTNBRANCH"
$MTN up 2>&1 | tee $TMP
2013-08-14 22:18:06 +00:00
2013-10-01 11:51:00 +00:00
if grep "^mtn: \(add\|patch\|dropp\|updat\)\(ed\|ing\) 'i2p2www/translations/" "$TMP" >/dev/null ; then
2013-08-14 22:18:06 +00:00
echo "Translations updated, compiling messages"
./compile-messages.sh
fi
if grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" "$TMP" >/dev/null ; then
2013-08-14 22:18:06 +00:00
echo "Python files changed, restarting server"
touch $TOUCHFILE
2013-08-14 22:18:06 +00:00
fi