It would be nice for the script to be easy to add inside an alias on my .bash_profile so that I only hit Ctrl + Z
and some alias and boom server up again without having to search manually on my text editor for the tmp/pids/server.pid and stopping that process and then removing the port id and then starting the server again. That for every time I need a forced stop.
Edited:
Based on some comments I'll clarify why I'm in this situation in the first place:
I use Ctrl+Z when I want to stop the server but I'm inside a binding.pry and don't want the rest of the process to run because it can lead to fill the DB with useless data which I will have to delete later. If you try stopping the server inside of the binding with the classic Ctrl+C it will never stop and hitting exit
will lead to the process to continue.