mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 05:44:08 -07:00
Auto-generating LE SSL for hostname
This commit is contained in:
parent
5823ca250e
commit
1b18519978
1 changed files with 28 additions and 6 deletions
|
@ -1482,17 +1482,39 @@ if [ "$release" -eq 10 ]; then
|
|||
service php7.3-fpm restart
|
||||
fi
|
||||
|
||||
# Comparing hostname and ip
|
||||
make_ssl=0
|
||||
host_ip=$(host $servername | head -n 1 | awk '{print $NF}')
|
||||
if [ "$host_ip" = "$ip" ]; then
|
||||
ip="$servername"
|
||||
make_ssl=1
|
||||
fi
|
||||
|
||||
# Generating LE SSL
|
||||
www_host="www.$servername"
|
||||
www_host_ip=$(host $www_host | head -n 1 | awk '{print $NF}')
|
||||
if [ "$www_host_ip" != "$ip" ]; then
|
||||
echo "=== Deleting www to server hostname"
|
||||
v-delete-web-domain-alias 'admin' "$servername" "$www_host" 'no'
|
||||
v-delete-dns-on-web-alias 'admin' "$servername" "$www_host" 'no'
|
||||
www_host=""
|
||||
fi
|
||||
|
||||
echo "Hostname $servername is pointing to $host_ip"
|
||||
|
||||
if [ $make_ssl -eq 1 ]; then
|
||||
echo "=== Generating HOSTNAME SSL"
|
||||
v-add-letsencrypt-domain 'admin' "$servername" "$www_host" 'yes'
|
||||
v-update-host-certificate 'admin' "$servername"
|
||||
else
|
||||
echo "=== We will not generate SSL because of this"
|
||||
fi
|
||||
echo "UPDATE_HOSTNAME_SSL='yes'" >> /usr/local/vesta/conf/vesta.conf
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta Access Info #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Comparing hostname and ip
|
||||
host_ip=$(host $servername| head -n 1 | awk '{print $NF}')
|
||||
if [ "$host_ip" = "$ip" ]; then
|
||||
ip="$servername"
|
||||
fi
|
||||
|
||||
# Sending notification to admin email
|
||||
echo -e "Congratulations, you have just successfully installed \
|
||||
Vesta Control Panel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue