mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-13 15:13:33 +01:00
line 515: deploy_args: unbound variable #174
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lingej on GitHub (Dec 20, 2016).
Hi
running dehydrated version
7f30826a6don Debian 8deploy_args is empty on line 515 if challenge_status is "valid" on line 474 ( https://github.com/lukas2511/dehydrated/blob/master/dehydrated#L474
Joerg
@speters commented on GitHub (Dec 20, 2016):
Same problem some lines below with check_altnames.
I solved this by surrounding with
if [[ ${deploy_args[@]:+${deploy_args[@]}} ]]; then [...] fi,if [[ ${check_altnames[@]:+${ceck_altnames[@]}} ]]; then [...] fi.But maybe there is a way for proper initialisation with Bash.
@Mareak commented on GitHub (Dec 20, 2016):
Hi,
You have to comment the line 476 :
473 challenge_status="$(printf '%s' "${response}" | rm_json_arrays | get_json_string_value status)"
474 if [ "${challenge_status}" = "valid" ]; then
475 echo " + Already validated"
476 #continue
477 fi
@whereisaaron commented on GitHub (Dec 21, 2016):
Commenting out the 'continue' works but break the feature it was supposed to add. I added a test for an empty array around the challenge loop that resolved it for me, and the feature to skip the challenge for already validated names works.
...
I created a pull request #321 to make this change.
@lukas2511 commented on GitHub (Dec 22, 2016):
I've merged #321, this should be fixed now. Thanks.
@evlrbot commented on GitHub (Dec 22, 2016):
Just installed and ran the patched code, but am still getting the same error that @lingej posted.
I'm using GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf) on Raspbian Jessie.
@lukas2511 commented on GitHub (Dec 22, 2016):
I tested a few ways of checking if the array is empty / the variables are undefined, and I think I found the most compatible way over multiple versions of bash, can you please try again?
@evlrbot commented on GitHub (Dec 23, 2016):
Just tested your latest changes, and no more error. Thanks!