#!/bin/bash

set -e

./stop.sh

echo Updating hg
#hg pull -u https://luanhost_update:njer2ndsBVG@hg.luan.software/luanhost
hg pull -u

../scripts/build-luan.sh

mkdir -p local
mkdir -p logs
rm -f logs/*
hg identify >logs/changeset.txt

#cp startup/mime.types local/mime.types;
#./luan.sh startup/nginx.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.conf
#./luan.sh startup/nginx.default.conf.luan $(pwd) $(whoami) $(id -gn) > local/nginx.default.conf

echo Starting...
./start.sh
