As Rudy has pointed out, You might add a function to test for nginx. Nice script.
At first glance, I would suggest enhancing the script with logging and error handling. Also #Comment the heck out of it to document the purpose and usage, etc.
Instead of running commands with sudo
directly in the script, you can create a function or a separate script that handles running commands with root privileges. This is important for security and makes your script more flexible.
Nuff said... good job! script hound