getssl
getssl copied to clipboard
Use wget if curl is unavailable
Default installation of Debian has wget installed, but not curl.
It would be handy if getssl could use wget when curl is missing. acme.sh does this.
It would be simpler to just install curl. curl is a well supported tool packaged for pretty much every distribution - so installing it shouldn't be an issue. And much lower risk of introducing a regression.
So, if no curl: check for a repo tool, such as apt-get (Debian), dnf (RedHat) and if one is available, try to install curl.
To avoid upseting the truly paranoid, prompt & ask permission first (it's a one-time thing)...and setup/first use is very likely to be interactive.
Supporting wget instead would complicate the code - and testing - a lot more than this approach, which would be one contiguous block of code.
I agree that adding support for wget will complicate the code, but not everyone has the luxury of being able to install tools on their servers - I use cpanel hosting and although I can get shell access and run scripts, I can't install anything.