view host/stop_nginx.sh @ 2137:67b504ba388c nginx_decoupled

don't assume the user's primary group name is the same as their username
author Violet7
date Mon, 19 Jan 2026 20:20:03 -0800
parents 3ca8f933209d
children bc999d5036fb
line wrap: on
line source

#!/bin/bash

set -e
. nginx_common.sh

NGINX_PID_FILE="$NGINX_PID_DIR/nginx.pid"

# if file exists and is non empty
if [ -s "$NGINX_PID_FILE" ]; then
	sudo nginx -c $NGINX_ROOT_CONFIG_FILE -s stop
else
	echo "PID file empty or non existent, doing nothing."
fi