From f0d8f77a56cc5a58e6598c5bb0259597e75be239 Mon Sep 17 00:00:00 2001 From: Mauricio Alvarez Leon <65101411+BBBmau@users.noreply.github.com> Date: Fri, 24 Jan 2025 12:47:26 -0800 Subject: [PATCH] add gadget directory check in `disabling adb` (#439) directory checking for disabling adb --- userspace/usr/comma/set_adb.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/userspace/usr/comma/set_adb.sh b/userspace/usr/comma/set_adb.sh index 5860d03..19401c8 100755 --- a/userspace/usr/comma/set_adb.sh +++ b/userspace/usr/comma/set_adb.sh @@ -47,8 +47,10 @@ start_gadget() { } stop_gadget() { - cd /config/usb_gadget/g1 - echo "" | sudo tee UDC + if [ -d "/config/usb_gadget/g1" ]; then + cd /config/usb_gadget/g1 + echo "" | sudo tee UDC + fi } ADB_PARAM="/data/params/d/AdbEnabled"