_debug "Detected ENV variable PANOS_KEY. Saving to file."
_savedeployconf PANOS_KEY "$PANOS_KEY"1
else
_debug "Attempting to load variable PANOS_KEY from file."
_getdeployconf PANOS_KEY
fi
#Store variables
#Store variables
_panos_host=$PANOS_HOST
_panos_host=$PANOS_HOST
_panos_key=$PANOS_KEY
_panos_user=$PANOS_USER
_panos_user=$PANOS_USER
_panos_pass=$PANOS_PASS
_panos_pass=$PANOS_PASS
#Test API Key if found. If the key is invalid, the variable panos_key will be unset.
#Load saved keys
_getdeployconf PANOS_KEY
_panos_key=$PANOS_KEY
#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
_debug "**** Testing API KEY ****"
_debug "**** Testing API KEY ****"
deployer keytest
deployer keytest
@ -198,8 +187,8 @@ panos_deploy() {
elif[ -z "$_panos_user"];then
elif[ -z "$_panos_user"];then
_err "No user found. If this is your first time deploying, please set PANOS_USER in ENV variables. You can delete it after you have successfully deployed the certs."
_err "No user found. If this is your first time deploying, please set PANOS_USER in ENV variables. You can delete it after you have successfully deployed the certs."
_err "No pass OR valid API key found. If this is your first time deploying please set PANOS_PASS and/or PANOS_KEY in ENV variables. You can delete them after you have succesfully deployed the certs."
elif[ -z "$_panos_pass"];then
_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
# Generate a new API key if no valid API key is found
# Generate a new API key if no valid API key is found