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 <[email protected]>
---
 networking/modem/setup.sh | 15 +++++++++------
 1 file 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
-- 
2.27.0

_______________________________________________
Replicant mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to