termux-packages/packages/termux-tools/su
Fredrik Fornwall 4cb7ec814f termux-tools: Update su
Search for /sbin/su, and remove termux-specific environment
so that system tools can be used for the root session.
2016-09-12 06:11:18 -04:00

19 lines
459 B
Bash
Executable File

#!/data/data/com.termux/files/usr/bin/sh
unset LD_LIBRARY_PATH
for p in /system/xbin/su /su/bin/su /sbin/su
do
if [ -x $p ]; then
# The su tool may require programs in PATH:
PATH=/sbin/su:/su/bin:/su/xbin:/system/bin:/system/xbin \
exec $p $@
fi
done
echo "No su program found on this device. Termux"
echo "does not supply tools for rooting, see e.g."
echo "http://www.androidcentral.com/root for"
echo "information about rooting Android."
exit 1