summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-06-19 05:51:07 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2020-06-26 01:58:12 +0200
commit2993f95755ca2d3aaf8377b05b6a4cd1c5e7a0fd (patch)
tree752cd4696a244ffac2308dd76118018a763d550d
parent56104cc6fa18347ca41df71eb87ae1a95b8302ce (diff)
downloadvendor_replicant-scripts-2993f95755ca2d3aaf8377b05b6a4cd1c5e7a0fd.tar.gz
vendor_replicant-scripts-2993f95755ca2d3aaf8377b05b6a4cd1c5e7a0fd.tar.bz2
vendor_replicant-scripts-2993f95755ca2d3aaf8377b05b6a4cd1c5e7a0fd.zip
modem: setup.sh: only continue if adb root succedded
This way if we don't have root access enable it will only show the following error message: root access is disabled by system setting - enable in settings -> development options Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xnetworking/modem/setup.sh15
1 files changed, 9 insertions, 6 deletions
diff --git a/networking/modem/setup.sh b/networking/modem/setup.sh
index 8f943f5..ba7a75c 100755
--- a/networking/modem/setup.sh
+++ b/networking/modem/setup.sh
@@ -1,8 +1,11 @@
#!/bin/sh
topdir=$(dirname $0)
-adb root
-adb wait-for-device
-adb remount
-adb push "${topdir}/device-files/modem.sh" /system/bin/
-adb shell "mount -o remount,ro /system"
-adb shell "sync"
+adb root | grep "^root access"
+ret="$?"
+if [ "${ret}" -ne 0 ] ; then
+ adb wait-for-device
+ adb remount
+ adb push "${topdir}/device-files/modem.sh" /system/bin/
+ adb shell "mount -o remount,ro /system"
+ adb shell "sync"
+fi