treewide: replace which with command -v

Fix shellcheck SC2230
> which is non-standard. Use builtin 'command -v' instead.

Once applied to everything concerning OpenWrt we can disable the busybox
feature `which` and save 3.8kB.

Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
Paul Spooren
2020-08-09 13:19:25 -10:00
parent 416dccf72a
commit 30ea917518
11 changed files with 28 additions and 28 deletions
+2 -2
View File
@@ -64,11 +64,11 @@ requires() {
die 2 "cannot load $module. Please install kmod-$module"
done
for cmd in $REQ_CMDS; do
which $cmd &>/dev/null ||
command -v $cmd &>/dev/null ||
die 2 "cannot find command $cmd. Please install $cmd"
done
if ! which ip6tables &>/dev/null; then
if ! command -v ip6tables &>/dev/null; then
v "Disabling IPv6 as ip6tables was not found"
IP6T=true
fi