From 09c716e76aa3c1ee789e580ab58a653f63c576fc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 17 Jan 2020 14:38:19 -0800 Subject: [PATCH] base-files/functions.sh: use command -v instead of which which must be executed. command -v is a shell builtin. https://github.com/koalaman/shellcheck/wiki/SC2230 Signed-off-by: Rosen Penev --- package/base-files/files/lib/functions.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh index 50a7b40869..0f02d67d18 100755 --- a/package/base-files/files/lib/functions.sh +++ b/package/base-files/files/lib/functions.sh @@ -160,7 +160,7 @@ default_prerm() { ret=$? fi - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" disable @@ -242,7 +242,7 @@ default_postinst() { [ -n "$root" ] || rm -f /tmp/luci-indexcache 2>/dev/null - local shell="$(which bash)" + local shell="$(command -v bash)" for i in $(grep -s "^/etc/init.d/" "$root/usr/lib/opkg/info/${pkgname}.list"); do if [ -n "$root" ]; then ${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable