Open csnover opened 6 months ago
Having directly escalated privileges instead of using those only for the required commands is a bad practice.
But just running the command could be a option. The which
approach was used as it was primarily developed for Linux Mint / Ubuntu where this works fine.
Looking for
nvme
dependency that is installed to/usr/sbin
usingwhich
does not work sincePATH
does not include that directory for regular users on at least Debian. Instead, just try running the command, and then report an error if it fails with a hint that the dependency is maybe missing (or, do like the shell script did and just have users escalate privileges themselves).