brianreumere / gandi-automatic-dns

Dynamic DNS shell script for Gandi
Other
100 stars 22 forks source link

timeout on openssl calls #38

Closed cyayon closed 9 months ago

cyayon commented 9 months ago

In some case, when Gandi API fail, I encountered some issue with infinite openssl calls.

I suggest you to add timeout <seconds> before each openssl calls.

For example (with a timeout of 15s) :

129c117
<     printf "%s" "$tmp_message" | timeout 15 openssl s_client -quiet -connect "$gandi" 2> /dev/null | tail -1
---
>     printf "%s" "$tmp_message" | openssl s_client -quiet -connect "$gandi" 2> /dev/null | tail -1
254c242
<     printf "%s" "$tmp_message" | timeout 15 openssl s_client -quiet -connect "$gandi" 2> /dev/null
---
>     printf "%s" "$tmp_message" | openssl s_client -quiet -connect "$gandi" 2> /dev/null

thanks.

brianreumere commented 9 months ago

This was suggested in #31 too. Not all operating systems have the timeout command, so I won't add it to the script. It is mentioned in the Installation section of the README that you can run timeout 15 gad... though.