# USB hotplug switcher.
# See https://links.sarava.org/tags/badusb
# https://www.kernel.org/doc/Documentation/usb/authorization.txt
-#
+# http://marc.info/?l=git-commits-head&m=131166366113680&w=2
# Parameters
BASENAME="`basename $0`"
elif [ "$BASENAME" == 'usb-status' ]; then
status="`cat /sys/module/usbcore/parameters/authorized_default`"
+ # The "authorized_default" module parameter of usbcore controls the default
+ # for the authorized_default variable of each USB host controller.
+ #
+ # -1 is authorized for all devices except wireless (default, old behaviour)
+ # 0 is unauthorized for all devices
+ # 1 is authorized for all devices
if [ "$status" == "0" ]; then
echo "Hotplug disabled."
elif [ "$status" == "1" ]; then
echo "Hotplug enabled."
+ elif [ "$status" == "-1" ]; then
+ echo "Hotplug enabled except wireless"
fi
fi