From 824fee7cf152ba9d9c2bcbf8832630737ef721c3 Mon Sep 17 00:00:00 2001 From: backslashxx <118538522+backslashxx@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:52:57 +0800 Subject: [PATCH] module/autopif: simplify find_busybox this is for simplification --- module/autopif.sh | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/module/autopif.sh b/module/autopif.sh index 63fb049..e826cb3 100644 --- a/module/autopif.sh +++ b/module/autopif.sh @@ -1,16 +1,9 @@ #!/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; } find_busybox() { - [ -n "$BUSYBOX" ] && exit 0 - 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 + command -v busybox "$@" } if date -D '%s' -d "$(date '+%s')" 2>&1 | grep -qE "bad date|invalid option"; then