module/autopif: simplify find_busybox

this is for simplification
This commit is contained in:
backslashxx 2024-12-24 15:52:57 +08:00
parent 5e22e0f59b
commit 824fee7cf1

View File

@ -1,16 +1,9 @@
#!/bin/sh #!/bin/sh
PATH=/data/adb/ap/bin:/data/adb/ksu/bin:/data/adb/magisk:/data/data/com.termux/files/usr/bin:$PATH
die() { echo "Error: $@!"; exit 1; } die() { echo "Error: $@!"; exit 1; }
find_busybox() { find_busybox() {
[ -n "$BUSYBOX" ] && exit 0 command -v busybox "$@"
for path in /data/adb/modules/busybox-ndk/system/*/busybox /data/adb/magisk/busybox /data/adb/ksu/bin/busybox /data/adb/ap/bin/busybox; do
if [ -f "$path" ]; then
BUSYBOX="$path"
exit 0
fi
done
exit 1
} }
if date -D '%s' -d "$(date '+%s')" 2>&1 | grep -qE "bad date|invalid option"; then if date -D '%s' -d "$(date '+%s')" 2>&1 | grep -qE "bad date|invalid option"; then