Просмотр исходного кода

Implement reset backend port function to nginx package.

Raphael Schneeberger 6 лет назад
Родитель
Сommit
4334e99b2a
1 измененных файлов с 14 добавлено и 1 удалено
  1. 14 1
      src/deb/nginx/postinst

+ 14 - 1
src/deb/nginx/postinst

@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 
 set -e
 
@@ -9,3 +9,16 @@ fi
 # Touch and set permisions on default log files on installation
 update-rc.d hestia defaults >/dev/null
 invoke-rc.d hestia start || true
+
+# Run triggers only on updates
+if [ ! -e "/usr/local/hestia/data/users/admin" ]; then
+    exit
+fi
+
+# Load hestia.conf
+source /usr/local/hestia/conf/hestia.conf
+
+# Reset backend port
+if [ ! -z "$BACKEND_PORT" ]; then
+    /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
+fi