# This is the main function that will call the other functions to deploy everything.
# This is the main function that will call the other functions to deploy everything.
panos_deploy(){
panos_deploy(){
_cdomain=$(echo"$1"| sed 's/*/WILDCARD_/g')#Wildcard Safe Filename
_ckey="$2"
_ckey="$2"
_cfullchain="$5"
_cfullchain="$5"
@ -242,6 +242,15 @@ panos_deploy() {
_getdeployconf PANOS_VSYS
_getdeployconf PANOS_VSYS
fi
fi
# PANOS_FILENAME
if["$PANOS_FILENAME"];then
_debug "Detected ENV variable PANOS_FILENAME. Saving to file."
_savedeployconf PANOS_FILENAME "$PANOS_FILENAME"1
else
_debug "Attempting to load variable PANOS_FILENAME from file."
_getdeployconf PANOS_FILENAME
fi
#Store variables
#Store variables
_panos_host=$PANOS_HOST
_panos_host=$PANOS_HOST
_panos_user=$PANOS_USER
_panos_user=$PANOS_USER
@ -249,6 +258,7 @@ panos_deploy() {
_panos_template=$PANOS_TEMPLATE
_panos_template=$PANOS_TEMPLATE
_panos_template_stack=$PANOS_TEMPLATE_STACK
_panos_template_stack=$PANOS_TEMPLATE_STACK
_panos_vsys=$PANOS_VSYS
_panos_vsys=$PANOS_VSYS
_panos_filename=$PANOS_FILENAME
#Test API Key if found. If the key is invalid, the variable _panos_key will be unset.
#Test API Key if found. If the key is invalid, the variable _panos_key will be unset.
if["$_panos_host"]&&["$_panos_key"];then
if["$_panos_host"]&&["$_panos_key"];then
@ -267,6 +277,12 @@ 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."
_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
return1
else
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