10-21-2021, 09:09 AM
(10-21-2021, 05:36 AM)lacriz Wrote:Code:sudo [ -d "/dev/ttyUSB2" ] echo "modem works" || "modem no worky"
This results in "modem no worky" even though:
1) it actually works
2) I can see that device e.g. using ls /dev/ttyUSB2
So now I have 2 more questions to be able to automate the whole workaround on Arch:
1) How can I find out which device in /dev is actually representing my eg25 modem? (I could not see any such path mentioned in ModemManager's output and also no command when entering ModemManager -h)
2) How can I check in bash if a /dev/BLABLA path exists / is working?
Modem will always be showing no worky because you are testing for a directory with the -d flag. You would have to test for a file in general with the -e flag or for a character device with the -c flag.
I don't know the details, but the modem always connects at /dev/ttyUSB2 as for example mentioned on megi's website.