mythic-beasts / dehydrated-mythic-dns01

Hook script for the dehydrated Let's Encrypt client to use Mythic Beasts DNS API
11 stars 11 forks source link

Avoid looping forever when hook is called with unchanged_cert #11

Open bscattergood opened 6 years ago

bscattergood commented 6 years ago

Ubuntu 18.04 has dehydrated 0.6.1 in the default repositories.

When running "dehydrated -c" and there are no certificates to update, that calls the hook with "unchanged_cert" and 5 additional parameters.

The hook script then hangs (as it will when run when the number of arguments isn't a multiple of 3), since "$1" is not empty, but "shift 3" fails and leaves the arguments alone.

Avoid this by checking if "$3" is empty instead.