Files
i2p.www/site-updater.sh
2013-12-08 20:16:46 +00:00

20 lines
535 B
Bash
Executable File

#!/bin/sh
. ./etc/update.vars
TMP=$(mktemp XXXXXXXXXX)
trap 'rm -f $TMP;exit' 0 1 2 15
mtn pull "mtn://$MTNURL?$MTNBRANCH"
mtn up 2>&1 | tee $TMP
if grep "^mtn: \(add\|patch\|dropp\|updat\)\(ed\|ing\) 'i2p2www/translations/" "$TMP" >/dev/null ; then
echo "Translations updated, compiling messages"
./compile-messages.sh
fi
if grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" "$TMP" >/dev/null ; then
echo "Python files changed, restarting server"
touch /tmp/2fcd2f17-c293-4f77-b4c9-9b266ba70daa
fi