run_AToMPM_local.sh 654 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash
  2. # Author: Yentl Van Tendeloo and Bentley James Oakes
  3. set -e
  4. echo "Running AToMPM script..."
  5. echo "Starting node..."
  6. node httpwsd.js &
  7. serverpid=$!
  8. sleep 3
  9. echo "Starting Python model transformation engine..."
  10. python mt/main.py&
  11. mtpid=$!
  12. sleep 1
  13. echo "AToMPM now running. Opening browser..."
  14. echo "Trying to run Google Chrome..."
  15. set +e
  16. google-chrome-stable http://localhost:8124/atompm
  17. ret=$?
  18. if [ $ret -ne 0 ]; then
  19. echo "Google Chrome not installed. Trying Firefox..."
  20. firefox http://localhost:8124/atompm
  21. fi
  22. ret=$?
  23. if [ $ret = 0 ]; then
  24. echo "Stopping AToMPM"
  25. kill $serverpid
  26. kill $mtpid
  27. echo "Finished!"
  28. fi