Simple script for starting, reloading and stopping nginx.

For simple use put it in one of the folders listed when running.

echo $path

The script

#!/bin/bash
binpath=/usr/local/nginx/sbin

if [[ -z $1 ]]
then
$binpath/nginx
action=start
elif [[ $1 == "start" ]]
then
$binpath/nginx
action=start
else
$binpath/nginx -s $1
action=$1
fi

if [[ $? == 0 ]]
then
echo "$action successfull"
else
echo "$action failed"
fi

Then use it the following ways.

nginx
nginx start
nginx reload
nginx stop