aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRosen Penev <rosenp@gmail.com>2020-01-17 14:38:19 -0800
committerPetr Štetiar <ynezz@true.cz>2020-07-11 14:42:32 +0200
commit8e6f2c029f72d79d263290a415dc8063307a9a42 (patch)
tree467f861b4923541e10dd606dff9a07a74bbb67aa /package/base-files
parentdec9ae6d9e8352498b19287b6361c83701308662 (diff)
downloadupstream-8e6f2c029f72d79d263290a415dc8063307a9a42.tar.gz
upstream-8e6f2c029f72d79d263290a415dc8063307a9a42.tar.bz2
upstream-8e6f2c029f72d79d263290a415dc8063307a9a42.zip
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 <rosenp@gmail.com>
Diffstat (limited to 'package/base-files')
-rwxr-xr-xpackage/base-files/files/lib/functions.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index a77b669709..323e057451 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -176,7 +176,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
@@ -264,7 +264,7 @@ default_postinst() {
rm -f /tmp/luci-indexcache
fi
- local shell="$(which bash)"
+ local shell="$(command -v bash)"
for i in $(grep -s "^/etc/init.d/" "$root$filelist"); do
if [ -n "$root" ]; then
${shell:-/bin/sh} "$root/etc/rc.common" "$root$i" enable