From 1fdf6b745cc3d85be3743837817a360121554134 Mon Sep 17 00:00:00 2001 From: Paul Spooren Date: Sun, 9 Aug 2020 15:33:37 -1000 Subject: treewide: replace `which` with `command -v` Fix shellcheck SC2230 > which is non-standard. Use builtin 'command -v' instead. Using `command -v` is POSIX compliant while `which` is not. Also to mention, `command -v` is a shell builtin whereas `which` is a separate busybox applet. Once applied to everything concerning OpenWrt we can disable the busybox feature `which` and save 3.8kB. Acked-by: Stijn Tintel Signed-off-by: Paul Spooren [also replace cases in zram-swap] Signed-off-by: Adrian Schmutzler --- package/system/zram-swap/files/zram.init | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'package/system/zram-swap/files') diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init index a6126e578f..42c084855a 100755 --- a/package/system/zram-swap/files/zram.init +++ b/package/system/zram-swap/files/zram.init @@ -35,17 +35,17 @@ zram_applicable() return 1 } - which mkswap >/dev/null || { + command -v mkswap >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'mkswap' not installed" return 1 } - which swapon >/dev/null || { + command -v swapon >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapon' not installed" return 1 } - which swapoff >/dev/null || { + command -v swapoff >/dev/null || { logger -s -t zram_applicable -p daemon.err "[ERROR] 'swapoff' not installed" return 1 } -- cgit v1.2.3