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
+1 -1
View File
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=mwan3
PKG_VERSION:=2.8.12
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Florian Eckert <fe@dev.tdt.de>
PKG_LICENSE:=GPL-2.0
+4 -4
View File
@@ -23,19 +23,19 @@ if_down() {
validate_track_method() {
case "$1" in
ping)
which ping 1>/dev/null 2>&1 || {
command -v ping 1>/dev/null 2>&1 || {
$LOG warn "Missing ping. Please install iputils-ping package or enable ping util and recompile busybox."
return 1
}
;;
arping)
which arping 1>/dev/null 2>&1 || {
command -v arping 1>/dev/null 2>&1 || {
$LOG warn "Missing arping. Please install iputils-arping package."
return 1
}
;;
httping)
which httping 1>/dev/null 2>&1 || {
command -v httping 1>/dev/null 2>&1 || {
$LOG warn "Missing httping. Please install httping package."
return 1
}
@@ -45,7 +45,7 @@ validate_track_method() {
}
;;
nping-*)
which nping 1>/dev/null 2>&1 || {
command -v nping 1>/dev/null 2>&1 || {
$LOG warn "Missing nping. Please install nping package."
return 1
}