Skip to content

Instantly share code, notes, and snippets.

@tspspi
Created November 21, 2018 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tspspi/7ea094f95b9a0502041c8861dd8c8304 to your computer and use it in GitHub Desktop.
Save tspspi/7ea094f95b9a0502041c8861dd8c8304 to your computer and use it in GitHub Desktop.
FreeBSD rc.d init script for sysutils/usb_modeswitch with Huawei Modem
#!/bin/sh
# PROVIDE: usbmodeswitch
# REQUIRE: FILESYSTEMS
# BEFORE: ppp
# usb modeswitch script for huawei modem
# with sysutils/usb_modeswitch
. /etc/rc.subr
name="usbmodeswitch"
start_cmd="usbmodeswitch_start"
stop_cmd=":"
rcvar="usbmodeswitch_enable"
usbmodeswitch_start()
{
/usr/local/sbin/usb_modeswitch -v 0x12d1 -p 0x1f01 -V 0x12d1 -P 0x14dc -M "55534243123456780000000000000011063000000100010000000000000000"
/bin/sleep 10
}
load_rc_config $name
run_rc_command "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment