I use Mobile Broadband, and there is currently a bug where the Huawei E173 dongle has to be kicked awake each boot with this terminal command before I can get online:
sudo modprobe usbserial vendor=0x12d1 product=0x1c10
I was thinking it must be possible to automate this in a simple script, or maybe it's even easier than that. In Mint 11 and 12/Ubuntu 11.04 and 11.10 this dongle worked fine without meddling.
This was maybe insanely naive, but I made a file called startdongle.sh with this in it:
#!/bin/sh
modprobe usbserial vendor=0x12d1 product=0x1c10
Then I moved that into the file system with the sudo mv command and changed the permissions with the sudo chmod u+x command and added this moved file to the startup programs (maybe this last step was unnecessary anyway?). I have only had one attempt at scripting before, which failed and frustrated enough to keep me away from it from then, but I've become curious again. I imagine this is stupidly easy to regular bash people - one little line. Presumably there is something about the form of the line which means the module can't be invoked with these parameters where they normally are in the filesystem.
Hopefully I haven't caused anyone's ribs to crack laughing... All help appreciated. Thanks.
Can this line be a script/ be automated? [Solved]
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
Can this line be a script/ be automated? [Solved]
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Can this line be a script/ be automated?
I think you can edit (as root) the /etc/rc.local and make an entry for startdongle.sh in that file.
and add a single line that reads:
Code: Select all
sudo vi /etc/rc.local
Code: Select all
/absolute/path/to/startdongle.sh
Re: Can this line be a script/ be automated?
Thanks. It's turned out to be even simpler after finding a similar request for an automated terminal command function. The same /etc/rc.local file you suggest just has the
sudo modprobe usbserial vendor=0x12d1 product=0x1c10
added to it before the line begining 'exit'. So I've been able to get rid of the script.
sudo modprobe usbserial vendor=0x12d1 product=0x1c10
added to it before the line begining 'exit'. So I've been able to get rid of the script.
Re: Can this line be a script/ be automated? [Solved]
"sudo" is unnecessary when using /etc/rc.local
should be sufficient.
Code: Select all
modprobe usbserial vendor=0x12d1 product=0x1c10
Re: Can this line be a script/ be automated? [Solved]
Thanks, I've amended that. I had just copied the form of the other example I found...