1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh if [ x"$ACTION" = x"change" -a x"$POWER_SUPPLY_TYPE" = x"USB" ] then if [ $POWER_SUPPLY_ONLINE -eq 1 ] then uk-send usbwatcher "USB-plugged" || usb-usbnet usb-usbnet else uk-send usbwatcher "USB-unplugged" usb-unplug fi fi