# This is the main function that will call the other functions to deploy everything.
panos_deploy(){
_cdomain=$(echo"$1"| sed 's/*/WILDCARD_/g')#Wildcard Safe Filename
_ckey="$2"
_cfullchain="$5"
@ -242,13 +243,13 @@ panos_deploy() {
_getdeployconf PANOS_VSYS
fi
# PANOS_FILENAME
if["$PANOS_FILENAME"];then
_debug "Detected ENV variable PANOS_FILENAME. Saving to file."
_savedeployconf PANOS_FILENAME "$PANOS_FILENAME"1
# PANOS_CERTNAME
if["$PANOS_CERTNAME"];then
_debug "Detected ENV variable PANOS_CERTNAME. Saving to file."
_savedeployconf PANOS_CERTNAME "$PANOS_CERTNAME"1
else
_debug "Attempting to load variable PANOS_FILENAME from file."
_getdeployconf PANOS_FILENAME
_debug "Attempting to load variable PANOS_CERTNAME from file."
_getdeployconf PANOS_CERTNAME
fi
#Store variables
@ -258,7 +259,7 @@ panos_deploy() {
_panos_template=$PANOS_TEMPLATE
_panos_template_stack=$PANOS_TEMPLATE_STACK
_panos_vsys=$PANOS_VSYS
_panos_filename=$PANOS_FILENAME
_panos_certname=$PANOS_CERTNAME
#Test API Key if found. If the key is invalid, the variable _panos_key will be unset.
if["$_panos_host"]&&["$_panos_key"];then
@ -277,10 +278,10 @@ panos_deploy() {
_err "No password found. If this is your first time deploying, please set PANOS_PASS in ENV variables. You can delete it after you have successfully deployed the certs."
return1
else
# Use filename based on the first domain on the certificate if no custom filename is set
if[ -z "$_panos_filename"];then
_panos_filename=$(echo"$1"| sed 's/*/WILDCARD_/g')#Wildcard Safe Filename