diff host/stop_nginx.sh @ 2136:3ca8f933209d nginx_decoupled

Initial; use ~/.nginx-luan/ as nginx master conf dir instead of trying to detect the system default.
author Violet7
date Mon, 19 Jan 2026 19:47:11 -0800
parents 6a2383baecb6
children bc999d5036fb
line wrap: on
line diff
--- a/host/stop_nginx.sh	Fri Jan 16 18:15:14 2026 -0800
+++ b/host/stop_nginx.sh	Mon Jan 19 19:47:11 2026 -0800
@@ -1,3 +1,13 @@
 #!/bin/bash
 
-sudo nginx -s stop;
+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