A BASH script I wrote has two requirements.
At the moment I check if they are installed this way and I thought it was a good solution until I had some complaints from users:
command -v fping >/dev/null 2>&1 || { echo >&2 "Sorry but fping is not installed. Aborting."; exit 1; }
command -v ifup >/dev/null 2>&1 || { echo >&2 "Sorry but ifupdown is not installed. Aborting."; exit 1; }
I would like to write this in a way that works for the highest possible numbers of platforms and potential user configuration (a path that doesn't contain /bin or /sbin, for example).
Do you have any suggestion to my check?