Skip to content

Commit 1077e41

Browse files
feat(experimental): run-script: change logic
1 parent 6264410 commit 1077e41

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

udroid/src/udroid.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ DEFAULT_ROOT="${TERMUX_PREFIX}/var/lib/udroid"
99
DEFAULT_FS_INSTALL_DIR="${DEFAULT_ROOT}/installed-filesystems"
1010
DLCACHE="${DEFAULT_ROOT}/dlcache"
1111
RTCACHE="${RTR}/.cache"
12+
EXEC_PWD="${PWD}"
1213

1314
[[ -d ${RTR} ]] && cd $RTR || exit 1
1415
[[ ! -f proot-utils/proot-utils.sh ]] && echo "proot-utils.sh not found" && exit 1
@@ -443,10 +444,11 @@ login() {
443444
if stat "${root_fs_path}/bin/su" >/dev/null 2>&1; then
444445
# run_script
445446
if [ -n "$run_script" ]; then
446-
if [ -f "$run_script" ]; then
447-
LOG "login() => run-script defined.."
448-
chmod +x "$run_script"
449-
cp "$run_script" "${root_fs_path}/tmp/"
447+
script=$EXEC_PWD/$run_script
448+
if [ -f "$script" ]; then
449+
LOG "login() => run-script defined as '$run_script' at '$script'"
450+
chmod +x "$script"
451+
cp "$script" "${root_fs_path}/tmp/"
450452
run_script="/tmp/$(basename "$run_script")"
451453
set -- "/bin/su" "-l" "$login_user" "-c" "$run_script"
452454
else

0 commit comments

Comments
 (0)