Skip to content

Commit

Permalink
box.service: create a symbolic link to busybox
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot-preview[bot] committed Oct 24, 2023
1 parent 213c880 commit f708988
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions box/scripts/box.service
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f708988

Please sign in to comment.