OpenWrt Forum Archive

Topic: [HOWTO] Autostart UMTS-Dongle at USB Plug In

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!
I managed to get my USB-UMTS-Dongle working, but had to start it via web interface everytime.

Just change /etc/hotplug.d/usb/10-usb-storage to the following and it will start automatically when plugged in:

#!/bin/sh

# Copyright (C) 2006 OpenWrt.org

case "$ACTION" in
        add)
                [ -n "${INTERFACE}" ] &&
                [ "$(expr substr ${INTERFACE} 1 2)" == "8/" ]  && {
                        /sbin/usb-storage &
                }
                  
                [ -n "${INTERFACE}" ] &&
                [ "$(expr substr ${INTERFACE} 1 6)" == "10/0/0" ]  && {
                        /sbin/ifup ppp0 &
                }                      
                ;;                     
esac

Have fun!

Good stuff. I used a similar approach:

In hotplug2-common.rules:

SUBSYSTEM == usb-serial, DEVICENAME ~~ (ttyUSB0) {
    exec /bin/cardmanager;
}

cardmanager is a little program I wrote to talk to the modem and auto configure the UCI settings for it, then ifup.

The discussion might have continued from here.