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"