install_easy: universal linked_to_busybox detection

This commit is contained in:
bol-van 2021-10-30 13:47:14 +03:00
parent 077849094e
commit 2d9ba2fe82

View File

@ -915,15 +915,15 @@ check_packages_openwrt()
is_linked_to_busybox() is_linked_to_busybox()
{ {
local F P local IFS F P
F=/usr/bin/$1
IFS=:
for path in $PATH; do
F=$path/$1
P="$(readlink $F)" P="$(readlink $F)"
if [ -z "$P" ] && [ -x $F ] && [ ! -L $F ]; then return 1; fi if [ -z "$P" ] && [ -x $F ] && [ ! -L $F ]; then return 1; fi
[ "${P%busybox*}" != "$P" ] && return [ "${P%busybox*}" != "$P" ] && return
F=/bin/$1 done
P="$(readlink $F)"
if [ -z "$P" ] && [ -x $F ] && [ ! -L $F ]; then return 1; fi
[ "${P%busybox*}" != "$P" ]
} }
check_prerequisites_openwrt() check_prerequisites_openwrt()