chiark / gitweb /
termux-tools: Search in more places for su
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 28 Mar 2016 17:07:00 +0000 (13:07 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 28 Mar 2016 17:07:00 +0000 (13:07 -0400)
packages/termux-tools/build.sh
packages/termux-tools/su

index 5e9bc18f9cb9c04e0bd1ad9a6255ddf259cd149b..7bee5ff95df7c9080e40a0b18b2b1b063ec22107 100644 (file)
@@ -1,6 +1,6 @@
 TERMUX_PKG_HOMEPAGE=http://termux.com/
 TERMUX_PKG_DESCRIPTION="Some tools for Termux"
-TERMUX_PKG_VERSION=0.21
+TERMUX_PKG_VERSION=0.22
 
 termux_step_make_install () {
        $CXX $CFLAGS $LDFLAGS -std=c++14 -Wall -Wextra -pedantic -Werror $TERMUX_PKG_BUILDER_DIR/*.cpp -o $TERMUX_PREFIX/bin/termux-elf-cleaner
index 5b4742939b2a16fa86208c99802fe5d8b3401a3e..e4a9bd82107dbcc307957d1ab9ca3a2bcd119721 100755 (executable)
@@ -1,12 +1,16 @@
 #!/bin/sh
 
-if [ -x /system/xbin/su ]; then
-       # The su tool may require programs from /system/bin in path:
-       PATH=/system/bin:$PATH /system/xbin/su $@
-else
-       echo "There is no su program 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
-fi
+for p in /system/xbin/su /su/bin/su
+do
+       if [ -x $p ]; then
+               # The su tool may require programs
+               # from /system/bin in path:
+               PATH=/system/bin:$PATH exec $p $@
+       fi
+done
+
+echo "There is no su program 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