diff options
Diffstat (limited to 'usb-enable')
-rwxr-xr-x | usb-enable | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/usb-enable b/usb-enable new file mode 100755 index 0000000..cc4525e --- /dev/null +++ b/usb-enable @@ -0,0 +1,17 @@ +#!/bin/bash +# +# USB hotplug switcher. +# See https://links.sarava.org/tags/badusb +# + +# Parameters +BASENAME="`basename $0`" + +# Dispatch +if [ "$BASENAME" == 'usb-enable' ]; then + sudo su -c "echo '-1' > /sys/module/usbcore/parameters/authorized_default" +elif [ "$BASENAME" == 'usb-disable' ]; then + sudo su -c "echo '0' > /sys/module/usbcore/parameters/authorized_default" +elif [ "$BASENAME" == 'usb-status' ]; then + cat /sys/module/usbcore/parameters/authorized_default +fi |