2020-05-24 14:02:23 +02:00
|
|
|
#!/bin/bash
|
|
|
|
gname=rpikvm
|
|
|
|
|
|
|
|
cd /sys/kernel/config/usb_gadget/$gname
|
|
|
|
|
|
|
|
echo "Disable gadget"
|
|
|
|
echo "" > UDC
|
|
|
|
|
|
|
|
echo "Clean up configs"
|
2020-05-24 19:36:17 +02:00
|
|
|
rm configs/c.1/hid.kbd0
|
2020-05-24 20:02:59 +02:00
|
|
|
rm configs/c.1/hid.mouse0
|
2020-06-04 14:00:54 +02:00
|
|
|
rm configs/c.1/hid.mouse1
|
2020-05-24 19:36:17 +02:00
|
|
|
rm configs/c.1/mass_storage.disk1
|
|
|
|
rm configs/c.1/mass_storage.cdrom1
|
2020-05-24 14:20:06 +02:00
|
|
|
|
2020-05-24 14:02:23 +02:00
|
|
|
rmdir configs/c.1/strings/0x409
|
|
|
|
rmdir configs/c.1
|
|
|
|
|
|
|
|
echo "Clean up functions"
|
2020-05-24 19:36:17 +02:00
|
|
|
rmdir functions/hid.kbd0
|
2020-05-24 20:02:59 +02:00
|
|
|
rmdir functions/hid.mouse0
|
2020-06-04 14:00:54 +02:00
|
|
|
rmdir functions/hid.mouse1
|
2020-05-24 19:36:17 +02:00
|
|
|
rmdir functions/mass_storage.disk1
|
|
|
|
rmdir functions/mass_storage.cdrom1
|
2020-05-24 14:02:23 +02:00
|
|
|
|
|
|
|
echo "Clean up strings"
|
|
|
|
rmdir strings/0x409
|
|
|
|
|
|
|
|
echo "Removing gadget"
|
|
|
|
cd ..
|
|
|
|
rmdir $gname
|
|
|
|
|
|
|
|
|
|
|
|
echo "All done"
|