Skip to content

Commit

Permalink
meta-lxatac-software: tac-gadget: fix shellcheck warnings gadget-common
Browse files Browse the repository at this point in the history
This change is less mechanic than the previous tac-gadget shellcheck
change and required some more thinking, which is why it is split
out from the rest.

Signed-off-by: Leonard Göhrs <[email protected]>
  • Loading branch information
hnez committed Jan 26, 2024
1 parent 4f825d9 commit f3b1642
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ PRODUCTNAME="LXATAC"
UDC_ADDR="49000000.usb-otg"

clear_gadget () {
already_set_up="false"
for dir in "${MAINDIR}"/*; do
test -s "${dir}/UDC" && already_set_up="true"
done

if [[ -s "${DEVDIR}/UDC" ]]; then
echo "USB Gadget is already set up."
exit 11
elif [[ -s "${MAINDIR}"/*/UDC ]]; then
elif [[ "x${already_set_up}" != "xfalse" ]]; then
echo "Remove existing USB Gadgets."
# when removing a gadget we have to reverse the init process
for dir in "${MAINDIR}"/*/configs/*/strings/*; do
Expand Down

0 comments on commit f3b1642

Please sign in to comment.