#!/bin/bash -e

. which_user  # sets $user and $home, will exit if borked

lang=${lang:-en}

cd /var/www/$user
wget http://www.ffii.org/~zoobab/demopage/index-$lang.html
[ -e index.html ] && {
	cp -i index{,.`date +%s`.bak}.html
	mv -i index{,.orig}.html
}
mv -i index{-$lang,}.html

echo done, please check your website http://$user.`dnsdomainname`/
echo You might need to edit the new index.html and fix the link at the bottom.
