Previous version add bugs that were not properly using the _api_key.
It also enforced to provide PANOS_USER and PANOS_PASSWORD which can be very constraining.
PANOS_KEY now has precedence. If not provided, the script falls back to PANOS_USER and PANOS_PASSWORD.
kislyuk yq (used by Debian packages) does not accept `yq e` and
also returns strings with double quotes.
mikefarah's yq-go (used by Alpine) accepts `yq e` and `yq`.
replace `yq e` with `yq` and also use `-r` switch to remove double
quoting to ensure uniform return values from both yq versions.
Signed-off-by: invario <67800603+invario@users.noreply.github.com>
Before this, some deployment scripts would interact with STDIN and that would cause this loop to skip some elements. By using descriptor 3 we avoid clashing with the very common stdin and stdout.
Before this, the eval call would try to run some commands (if they were compound commands) in the yaml file on the machine running acme.sh
Eval might not be worth it for the little benefit it brings.
The config file checks were returning okay even when there were errors. The yq tool returns "null" when it cannot find what's queried, but exists with a 0 rc still.
- Prefer using a pipe to `while read`
- But use a temp file when the loop needs to modify variables that need to be used outside the loop, as the pipe creates a subshell and modifications do not survive after the loop exits.