diff --git a/riot/start.sh b/riot/start.sh index 8e7e742f98..143e5d9f8f 100755 --- a/riot/start.sh +++ b/riot/start.sh @@ -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 diff --git a/run.sh b/run.sh index c59627e3a6..02b2e4cbdf 100755 --- a/run.sh +++ b/run.sh @@ -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