autodetect cert for https, output login info when done

This commit is contained in:
Matthew Saunders Brown 2024-02-16 11:06:03 -08:00
parent a7137ff1bf
commit 0ac16d6e0e

View File

@ -178,7 +178,12 @@ function validate_u() {
fi fi
} }
if [ -z "${input_values_array[r]}" ] ; then if [ -z "${input_values_array[r]}" ] ; then
input_values_array[r]="www.${input_values_array[v]}" if [ -f /etc/ssl/letsencrypt/${input_values_array[v]}.pem ]; then
HTTP=https
else
HTTP=http
fi
input_values_array[r]="$HTTP://www.${input_values_array[v]}"
fi fi
if [ -n "${input_values_array[r]}" ] ; then if [ -n "${input_values_array[r]}" ] ; then
validate_u validate_u
@ -375,6 +380,13 @@ EOF
/usr/bin/rm $virtualhost_basedir/${input_values_array[v]}/$virtualhost_htdocsdir/index.html /usr/bin/rm $virtualhost_basedir/${input_values_array[v]}/$virtualhost_htdocsdir/index.html
fi fi
echo "WordPress Installed for ${input_values_array[v]}"
echo "URL: ${input_values_array[r]}"
echo "Admin Login: ${input_values_array[r]}/wp-login.php"
echo "Admin Email: ${input_values_array[e]}"
echo "Admin Username: ${input_values_array[u]}"
echo "Admin Password: ${input_values_array[p]}"
elif [[ "$option" == "q" ]]; then elif [[ "$option" == "q" ]]; then
echo "Quiting without installing." echo "Quiting without installing."
elif [[ " ${input_keys_index[@]} " =~ " $option " ]]; then elif [[ " ${input_keys_index[@]} " =~ " $option " ]]; then