diff --git a/kill_ports.sh b/kill_ports.sh new file mode 100755 index 0000000..7f941b8 --- /dev/null +++ b/kill_ports.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Ports to check and kill +PORTS=(8080 3030 4200) + +for port in "${PORTS[@]}"; do + echo "Checking port $port..." + + PID=$(lsof -ti tcp:$port) + + if [ -n "$PID" ]; then + echo "Killing process on port $port with PID: $PID" + kill -9 $PID + else + echo "No process found on port $port." + fi +done \ No newline at end of file diff --git a/start_local.sh b/start_local.sh old mode 100644 new mode 100755 index 85e015c..7715714 --- a/start_local.sh +++ b/start_local.sh @@ -6,37 +6,22 @@ base_dir="$(pwd)/aoame" # Change directory and start fuseki server git_name=fuseki-heroku-test cd "$base_dir/$git_name" +echo "### STARTING fuseki-server.sh ###" sh -x fuseki-server.sh & +echo "### fuseki-server.sh STARTED ###" # Change directory and start web server for web service git_name=OntologyBasedModellingEnvironment-WebService cd "$base_dir/$git_name" +echo "### STARTING start_webserver.sh ###" sh -x start_webserver.sh & +echo "### start_webserver.sh STARTED ###" # Change directory and start server for web app git_name=OntologyBasedModellingEnvironment-WebApp cd "$base_dir/$git_name" +export NODE_OPTIONS=--openssl-legacy-provider +ng build +echo "### ng build DONE ###" node server.js - -#!/bin/bash - -# Set the base directory -base_dir="$(pwd)/aoame" - -# Change directory and start fuseki server -git_name=fuseki-heroku-test -cd "$base_dir/$git_name" -sh -x fuseki-server.sh & - -# Change directory and start web server for web service -git_name=OntologyBasedModellingEnvironment-WebService -cd "$base_dir/$git_name" -sh -x start_webserver.sh & - -# Set trap to stop all child processes when this script receives SIGINT, SIGTERM, or EXIT signals -trap 'pkill -P $$' SIGINT SIGTERM EXIT - -# Change directory and start server for web app -git_name=OntologyBasedModellingEnvironment-WebApp -cd "$base_dir/$git_name" -node server.js & \ No newline at end of file +echo "### node server.js DONE ###" \ No newline at end of file