File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
22HESTIA=" /usr/local/hestia"
33HESTIA_BACKUP=" /root/hst_upgrade/$( date +%d%m%Y%H%M) "
4+ spinner=" /-\|"
45
56# load hestia.conf
67source $HESTIA /conf/hestia.conf
@@ -71,6 +72,28 @@ if [ ! -z "$BACKEND_PORT" ]; then
7172 /usr/local/hestia/bin/v-change-sys-port $BACKEND_PORT
7273fi
7374
75+ # Generating dhparam.
76+ if [ -z /etc/ssl/dhparam.pem ]; then
77+ echo " (*) Enabling HTTPS Strict Transport Security (HSTS) support"
78+ echo -n " This will take some time, please wait..."
79+ openssl dhparam 4096 -out /etc/ssl/dhparam.pem > /dev/null 2>&1 &
80+ BACK_PID=$!
81+
82+ # Check if package installation is done, print a spinner
83+ spin_i=1
84+ while kill -0 $BACK_PID > /dev/null 2>&1 ; do
85+ printf " \b${spinner: spin_i++% ${# spinner} : 1} "
86+ sleep 0.5
87+ done
88+
89+ # Do a blank echo to get the \n back
90+ echo
91+
92+ # Update dns servers in nginx.conf
93+ dns_resolver=$( cat /etc/resolv.conf | grep -i ' ^nameserver' | cut -d ' ' -f2 | tr ' \r\n' ' ' | xargs)
94+ sed -i " s/1.0.0.1 1.1.1.1/$dns_resolver /g" /etc/nginx/nginx.conf
95+ fi
96+
7497# Update default page templates
7598echo " (*) Replacing default templates and packages..."
7699echo " Existing templates have been backed up to the following location:"
You can’t perform that action at this time.
0 commit comments