distribution/packages/jelos/autostart/081-usbgadget
Christophe Branchereau ffdda73395 usbgadget: add mtp function
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com>
2024-01-15 00:12:24 +01:00

10 lines
350 B
Bash
Executable file

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
if [ -r /storage/.cache/usbgadget/usbgadget.conf ] ; then
USB_MODE=$(cat /storage/.cache/usbgadget/usbgadget.conf | cut -d "=" -f2)
if [ "${USB_MODE}" = cdc ] || [ "${USB_MODE}" = mtp ]; then
/usr/bin/usbgadget start $USB_MODE
fi
fi