Здравствуйте.
root@fs1:~# /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
root@fs1:~# echo $?
0
root@fs1:~# echo zzz >> /usr/local/nginx/conf/nginx.conf
root@fs1:~# /usr/local/nginx/sbin/nginx -t
nginx: [emerg] unexpected end of file, expecting ";" or "}" in /usr/local/nginx/conf/nginx.conf:248
nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
root@fs1:~# echo $?
1
Проверять exitcode команды любым удобным способом.
Можно /usr/local/nginx/sbin/nginx -t && kill -HUP `cat /var/run/nginx.pid`