From f708988d1974e7d545fcee49c5b82d950fba4c73 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 18:26:49 +0700 Subject: [PATCH] box.service: create a symbolic link to busybox --- box/scripts/box.service | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/box/scripts/box.service b/box/scripts/box.service index 1d2c5e1..35cada3 100755 --- a/box/scripts/box.service +++ b/box/scripts/box.service @@ -662,11 +662,20 @@ force_stop() { fi } -# Check whether busybox is installed or not on the system using command -v -if ! command -v busybox &> /dev/null; then +# determine the busybox location +# check if there is a busybox in another location, and if so, use that one +busybox="/data/adb/magisk/busybox" +[ -f "${busybox}" ] || busybox="/data/adb/ksu/bin/busybox" +# create a symbolic link to busybox in the specified directory (assume $bin_dir is specified previously) +ln -sf "${busybox}" "${bin_dir}/busybox" || { + log Error "Failed to create symbolic link ${bin_dir}/busybox" + exit 1 +} +# check if the 'busybox' command can be found +command -v busybox &> /dev/null || { log Error "busybox command not found." exit 1 -fi +} case "$1" in start)