Skip to content

Commit e07608d

Browse files
author
Kristan Kenney
authored
Merge pull request hestiacp#1712 from jaapmarcus/fix/1710-fix-unwantend-port-reset
Use port number hestia-nginx port number instead the default one.
2 parents 27556a9 + 326f4e6 commit e07608d

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

bin/v-change-sys-port

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,8 @@ check_hestia_demo_mode
5858
# Get original port
5959
ORIGINAL_PORT=$(cat $HESTIA/nginx/conf/nginx.conf | grep "listen" | sed 's/[^0-9]*//g')
6060

61-
# Check if system variable is set
62-
if [ ! -n "$BACKEND_PORT" ]; then
63-
echo "BACKEND_PORT='$port'" >> $HESTIA/conf/hestia.conf
64-
source $HESTIA/conf/hestia.conf
65-
fi
66-
67-
# Check if port is different to hestia.conf
68-
if [ ! "$BACKEND_PORT" = "$PORT" ]; then
69-
sed -i s/BACKEND_PORT=\'$BACKEND_PORT\'/BACKEND_PORT=\'$PORT\'/g $HESTIA/conf/hestia.conf
70-
fi
61+
# Set new port in config via v-change-sys-config-value
62+
$HESTIA/bin/v-change-sys-config-value "BACKEND_PORT" $PORT
7163

7264
# Check if port is different to nginx.conf
7365
if [ "$ORIGINAL_PORT" = "$PORT" ]; then

func/syshealth.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ function syshealth_repair_system_config() {
236236

237237
# Backend port
238238
if [ -z "$BACKEND_PORT" ]; then
239-
echo "[ ! ] Adding missing variable to hestia.conf: BACKEND_PORT ('8083')"
240-
$BIN/v-change-sys-port '8083' >/dev/null 2>&1
239+
ORIGINAL_PORT=$(cat $HESTIA/nginx/conf/nginx.conf | grep "listen" | sed 's/[^0-9]*//g')
240+
echo "[ ! ] Adding missing variable to hestia.conf: BACKEND_PORT ('$ORIGINAL_PORT')"
241+
$HESTIA/bin/v-change-sys-config-value 'BACKEND_PORT' $PORT
241242
fi
242243

243244
# Upgrade: Send email notification

0 commit comments

Comments
 (0)