File tree Expand file tree Collapse file tree 3 files changed +6
-12
lines changed
Expand file tree Collapse file tree 3 files changed +6
-12
lines changed Original file line number Diff line number Diff line change 1+ echo " $$ " > $PREFIX /pid
12set -e # Exit immediately on Failure
23
34export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/share/bin:/usr/share/sbin:/usr/local/bin:/usr/local/sbin:/system/bin:/system/xbin:$PREFIX /local/bin
Original file line number Diff line number Diff line change 1- echo " $$ " > $PREFIX /pid
2-
31export LD_LIBRARY_PATH=$PREFIX
42export PROOT_TMP_DIR=$PREFIX /tmp
53
2725fi
2826
2927
30- $PROOT -b $PREFIX :$PREFIX -b /data:/data -b /system:/system -b /vendor:/vendor -b /sdcard:/sdcard -b /storage:/storage -S $PREFIX /alpine /bin/sh $PREFIX /init-alpine.sh " $@ "
28+ $PROOT --kill-on-exit - b $PREFIX :$PREFIX -b /data:/data -b /system:/system -b /vendor:/vendor -b /sdcard:/sdcard -b /storage:/storage -S $PREFIX /alpine /bin/sh $PREFIX /init-alpine.sh " $@ "
Original file line number Diff line number Diff line change @@ -27,12 +27,8 @@ const Terminal = {
2727 } ,
2828
2929 async stopAxs ( ) {
30- const filesDir = await new Promise ( ( resolve , reject ) => {
31- system . getFilesDir ( resolve , reject ) ;
32- } ) ;
33-
34- // Initiate total annihilation, burn it all, childrens included
35- await Executor . execute ( `kill -TERM -- -$(cat ${ filesDir } /pid)` )
30+ // Initiate total annihilation (childrens included)
31+ await Executor . execute ( `kill -KILL $(cat $PREFIX/pid)` )
3632 } ,
3733
3834 async isAxsRunning ( ) {
@@ -48,9 +44,8 @@ const Terminal = {
4844 if ( ! pidExists ) {
4945 return false
5046 }
51-
52- const pid = await Executor . execute ( `cat ${ filesDir } /pid` )
53- return await Executor . isRunning ( pid )
47+ const result = await Executor . execute ( `kill -0 $(cat $PREFIX/pid) 2>/dev/null && echo "true" || echo "false"` )
48+ return result
5449 } ,
5550
5651 async install ( logger = console . log , err_logger = console . error ) {
You can’t perform that action at this time.
0 commit comments