mirror of
https://github.com/stefanpejcic/openpanel
synced 2025-06-26 18:28:26 +00:00
parent
bccc411582
commit
8ddccde8e5
18
install.sh
18
install.sh
@ -1299,15 +1299,15 @@ set_email_address_and_email_admin_logins(){
|
|||||||
local message="$2"
|
local message="$2"
|
||||||
generate_random_token_one_time_only
|
generate_random_token_one_time_only
|
||||||
TRANSIENT=$(awk -F'=' '/^mail_security_token/ {print $2}' "${CONFIG_FILE}")
|
TRANSIENT=$(awk -F'=' '/^mail_security_token/ {print $2}' "${CONFIG_FILE}")
|
||||||
|
|
||||||
SSL=$(awk -F'=' '/^ssl/ {print $2}' "${CONFIG_FILE}")
|
PROTOCOL="http"
|
||||||
|
if [ "$SET_HOSTNAME_NOW" = true ]; then
|
||||||
# Determine protocol based on SSL configuration
|
if [[ $new_hostname =~ ^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ ]]; then
|
||||||
if [ "$SSL" = "yes" ]; then
|
if [ -f "/etc/openpanel/caddy/ssl/acme-v02.api.letsencrypt.org-directory/$new_hostname/$new_hostname.key" ]; then
|
||||||
PROTOCOL="https"
|
PROTOCOL="https
|
||||||
else
|
fi
|
||||||
PROTOCOL="http"
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Send email using appropriate protocol
|
# Send email using appropriate protocol
|
||||||
curl -k -X POST "$PROTOCOL://127.0.0.1:2087/send_email" -F "transient=$TRANSIENT" -F "recipient=$EMAIL" -F "subject=$title" -F "body=$message"
|
curl -k -X POST "$PROTOCOL://127.0.0.1:2087/send_email" -F "transient=$TRANSIENT" -F "recipient=$EMAIL" -F "subject=$title" -F "body=$message"
|
||||||
|
Loading…
Reference in New Issue
Block a user