File tree Expand file tree Collapse file tree 2 files changed +20
-11
lines changed
Expand file tree Collapse file tree 2 files changed +20
-11
lines changed Original file line number Diff line number Diff line change @@ -614,23 +614,17 @@ function syshealth_adapt_hestia_nginx_listen_ports() {
614614 done
615615
616616 # Adapt port listing in nginx.conf depended on availability of IPV4 and IPV6 network interface
617- NGINX_BCONF_CHANGED=" "
618- NGINX_BCONF=" /usr/local/hestia/nginx/conf/nginx.conf"
619- NGINX_BCONF_TEMP=" /tmp/nginx.conf"
620- cp " $NGINX_BCONF " " $NGINX_BCONF_TEMP "
617+ NGINX_CONF=" /usr/local/hestia/nginx/conf/nginx.conf"
621618 if [ -z " $ipv4_scope_global " ]; then
622- sed -i ' s/^\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/#\1/' " $NGINX_BCONF "
619+ sed -i ' s/^\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/#\1/' " $NGINX_CONF "
623620 else
624- sed -i ' s/#\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/\1/' " $NGINX_BCONF "
621+ sed -i ' s/#\([ \t]*listen[ \t]*[0-9]\{1,5\}.*\)/\1/' " $NGINX_CONF "
625622 fi
626623 if [ -z " $ipv6_scope_global " ]; then
627- sed -i ' s/^\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/#\1/' " $NGINX_BCONF "
624+ sed -i ' s/^\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/#\1/' " $NGINX_CONF "
628625 else
629- sed -i ' s/#\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/\1/' " $NGINX_BCONF "
626+ sed -i ' s/#\([ \t]*listen[ \t]*\[\:\:\]\:[0-9]\{1,5\}.*\)/\1/' " $NGINX_CONF "
630627 fi
631- cmp --silent " $NGINX_BCONF " " $NGINX_BCONF_TEMP "
632- [ $? -ne 0 ] && NGINX_BCONF_CHANGED=" yes"
633- rm -f " $NGINX_BCONF_TEMP " > /dev/null 2>&1
634628}
635629
636630syshealth_adapt_nginx_resolver () {
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Run triggers only on updates
4+ if [ ! -e " /usr/local/hestia/data/users/admin" ]; then
5+ exit
6+ fi
7+
8+ # Create a new Backup folder
9+ HESTIA_BACKUP=" /root/hst_nginx_backups/$( date +%d%m%Y%H%M) "
10+ mkdir -p HESTIA_BACKUP
11+
12+ # Create a backup of the current configuration
13+ cp -r /usr/local/hestia/nginx/conf/nginx.conf $HESTIA_BACKUP /nginx.conf
14+
15+ exit
You can’t perform that action at this time.
0 commit comments