diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2015-07-02 12:02:10 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2015-07-02 12:02:10 -0300 |
commit | 245914ce083785cc72b1c0b63309e743cf1ddd52 (patch) | |
tree | 1d7d2daf8bfafb14f30173de11a9d4b5b2d1c940 /usb-enable | |
download | badusb-switcher-245914ce083785cc72b1c0b63309e743cf1ddd52.tar.gz badusb-switcher-245914ce083785cc72b1c0b63309e743cf1ddd52.tar.bz2 |
Initial import
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 |