FWIW, Caddy does this the most correctly out of all the curl | sh
implementations I’ve ever seen, but I agree. wget
it, cat
, it, and then execute it.
Going back to the file path question asked earlier, I personally prefer an install path of /usr/local/bin
. The other option I recommend considering is /opt
. For me, I see both of these locations as where where non-distro software/scripts should go. The conventional directory layout is a good overview of what should go where in a Unix/Linux file systems.
I understand the need for something like /usr/bin/
for Termux. I guess the other option would be to fall back to it if /usr/local/bin
or /opt
aren’t available.
Thanks for your input – in fact, that’s what I’ve done with it; try /usr/local/bin first, then /usr/bin as a fallback.
Curious about one thing with this, when using to install caddy, will the script be able to handle upgrades as well? Or will you need to do something like:
- rm -f /usr/local/bin/caddy
- curl https://getcaddy.com | bash -s git
To update you would need to run the curl command again. The script automatically backups your current Caddy version and places the new one, so you don’t have to rm before
It backs it up to say /usr/local/bin/caddy_0.8.3
(If you were running 0.8.3 when upgrading) then upgrades /usr/local/bin/caddy
to the latest version. Check the script, it’s all there.