mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
Add a qualifier for path to curl? #327
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 @thegushi on GitHub (Apr 11, 2018).
Hey there,
When I run this script under FreeBSD's /etc/crontab, the default path is:
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
Even though I'm calling Dehydrated via its full path, it fails to find curl. Adding an override within the script to set the environment, or to specify the full path to curl would be useful.
Thanks.
@jobe1986 commented on GitHub (Apr 11, 2018):
In my own experience I have found it is best practice to be able to specify the full path to executables in scripts run via crontab to avoid issues with $PATH searching.
Also there is already an option to allow you to specify the OpenSSL binary (defaults to "openssl but could be set to a full path) so it makes sense there should be one for curl too.
@lukas2511 commented on GitHub (Apr 12, 2018):
@jobe1986 and then add a variable for a path to the sed binary? and for awk and grep? mktemp and diff would also be great... really i don't think this is necessary or even a good idea, that's exactly what the PATH variable was designed to solve. "openssl" binary can be set mostly for compatibility with libressl (but wouldn't even really be necessary, I just won't revert it as it would break some existing setups).
@thegushi you have to make sure that your PATH variable is actually exported, otherwise dehydrated won't see or use it.
If for whatever reason you are having problems with this you could in theory override either "curl" in your config (something like
curl() { /usr/bin/curl ${*}) or export a correct PATH variable in there (it's just a shell script that is sourced by dehydrated)Also isn't curl normally installed under /usr/local/bin on FreeBSD? That isn't in your PATH, that may be your problem.