Fixed a little crash if you stopped while nginx wasn't running.
Added a function that retrieves the pid of nginx.
Added a check to ensure that if nginx isn't running, it doesn't make an attempt to start the process to get the pid.