Created
June 17, 2021 04:40
-
-
Save tusqasi/b4725a07f96ba2262b2836131282dccc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/data/data/com.termux/files/usr/bin/bash | |
cd $(dirname $0) | |
## unset LD_PRELOAD in case termux-exec is installed | |
unset LD_PRELOAD | |
command="proot" | |
command+=" --link2symlink" | |
command+=" -0" | |
command+=" -r ubuntu-fs" | |
if [ -n "$(ls -A ubuntu-binds)" ]; then | |
for f in ubuntu-binds/* ;do | |
. $f | |
done | |
fi | |
command+=" -b /dev" | |
command+=" -b /proc" | |
command+=" -b ubuntu-fs/root:/dev/shm" | |
## uncomment the following line to have access to the home directory of termux | |
command+=" -b /data/data/com.termux/files/home:/root" | |
## uncomment the following line to mount /sdcard directly to / | |
#command+=" -b /sdcard" | |
command+=" -w /root" | |
command+=" /usr/bin/env -i" | |
command+=" HOME=/root" | |
command+=" PATH=/usr/local/sbin:/usr/local/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/games:/usr/local/games" | |
command+=" TERM=$TERM" | |
command+=" LANG=C.UTF-8" | |
command+=' PASSWORD=abc' | |
command+=" /bin/bash --login" | |
com="$@" | |
if [ -z "$1" ];then | |
exec $command | |
else | |
$command -c "$com" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment