element-web-Github/riot/start.sh

26 lines
504 B
Bash
Raw Normal View History

#!/bin/bash
PORT=5000
BASE_DIR=$(readlink -f $(dirname $0))
PIDFILE=riot.pid
CONFIG_BACKUP=config.e2etests_backup.json
2018-07-27 20:10:19 +08:00
cd $BASE_DIR/
if [ -f $PIDFILE ]; then
exit
fi
echo "running riot on http://localhost:$PORT ..."
2018-07-27 19:29:59 +08:00
pushd riot-web/webapp/ > /dev/null
# backup config file before we copy template
if [ -f config.json ]; then
mv config.json $CONFIG_BACKUP
fi
cp $BASE_DIR/config-template/config.json .
python -m SimpleHTTPServer $PORT > /dev/null 2>&1 &
PID=$!
2018-07-27 19:29:59 +08:00
popd > /dev/null
echo $PID > $PIDFILE