1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2026-01-13 04:02:20 +03:00

stop servers on error in run script

This commit is contained in:
Bruno Windels
2018-07-27 18:44:01 +02:00
parent 758da78659
commit 29d688543d
2 changed files with 16 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/bash
PORT=5000
echo "running riot on http://localhost:$PORT..."
echo "running riot on http://localhost:$PORT ..."
BASE_DIR=$(readlink -f $(dirname $0))
cd $BASE_DIR/
pushd riot-web/webapp/ > /dev/null

18
run.sh
View File

@@ -1,7 +1,19 @@
#!/bin/bash
set -e
stop_servers() {
./riot/stop.sh
./synapse/stop.sh
}
handle_error() {
EXIT_CODE=$?
stop_servers
exit $EXIT_CODE
}
trap 'handle_error' ERR
./synapse/start.sh
./riot/start.sh
node start.js
./riot/stop.sh
./synapse/stop.sh
stop_servers