Skip to content

Instantly share code, notes, and snippets.

@hongquan
Created April 17, 2014 17:57
Show Gist options
  • Save hongquan/11001424 to your computer and use it in GitHub Desktop.
Save hongquan/11001424 to your computer and use it in GitHub Desktop.
Script to switch USB 3G to modem
#!/bin/sh
if ! $(lsusb | grep E173 > /dev/null); then
echo 'Device not plugged'
exit
fi
if $(usb-devices | grep 'Driver=option' > /dev/null); then
echo 'Modem mode has been on'
exit
fi
echo 'mypassword' | sudo -S usb_modeswitch -v 0x12d1 -p 0x1c0b -M "55534243123456780000000000000011062000000100000000000000000000"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment