restart_server.sh 391 B

12345678910111213
  1. #!/bin/bash
  2. # Kill and restart server
  3. running="$(ps aux | grep '[e]lfcom-backend-exe' | awk '{print $2}')"
  4. if [ -z "$running" ]; then
  5. echo "Starting elfcom-backend-exe ..."
  6. stack exec elfcom-backend-exe config/dev.conf elfcom_version.txt &
  7. else
  8. kill $running
  9. echo "Restarting elfcom-backend-exe ..."
  10. stack exec elfcom-backend-exe config/dev.conf elfcom_version.txt &
  11. fi