#!/bin/bash

set -e

PIDS=$(
	ps -eo pid,args |
		awk '/[n]ginx: master process/ {print $1}'
)

if [ -n "$PIDS" ]; then
	kill -QUIT $PIDS
else
	echo "No nginx master process found, not attempting to stop."
fi
