diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-06-07 21:02:30 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-06-07 21:02:30 +0200 |
commit | 4f7e89f03cef469628b73000c4cf97eae6d566a0 (patch) | |
tree | a5116dfad5857973b9fef8ec0111683619acbfa4 | |
parent | 7793a14ab682a9b48f799fd4506cbf7ca44bd450 (diff) | |
download | vyos-1x-4f7e89f03cef469628b73000c4cf97eae6d566a0.tar.gz vyos-1x-4f7e89f03cef469628b73000c4cf97eae6d566a0.zip |
wwan: T2529: harden device completion helper
Commit 1c7d7cbd39 ("wwan: T2529: migrate device from ttyUSB to usbXbY.YpZ.Z")
added a new completion helper path for USB based serial interfaces. If no USB
based serial port was available on the system this produced the following
error: "ls: cannot access '/dev/serial/by-bus': No such file or directory"
Only list USB based serial interfaces if there is at least one connected to
the system.
-rw-r--r-- | interface-definitions/interfaces-wirelessmodem.xml.in | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/interface-definitions/interfaces-wirelessmodem.xml.in b/interface-definitions/interfaces-wirelessmodem.xml.in index d5f2e04d7..6989dea1b 100644 --- a/interface-definitions/interfaces-wirelessmodem.xml.in +++ b/interface-definitions/interfaces-wirelessmodem.xml.in @@ -48,15 +48,16 @@ <properties> <help>Serial device </help> <completionHelp> - <script>ls -1 /dev /dev/serial/by-bus | grep -e ttyS[0-9]* -e usb[0-9]*</script> + <script>ls -1 /dev | grep ttyS</script> + <script>if [ -d /dev/serial/by-bus ]; then ls -1 /dev/serial/by-bus; fi</script> </completionHelp> <valueHelp> <format>ttySXX</format> - <description>System TTY device name</description> + <description>TTY device name, regular serial port</description> </valueHelp> <valueHelp> <format>usbXbY.YpZ.Z</format> - <description>System TTY device name</description> + <description>TTY device name, USB based</description> </valueHelp> </properties> </leafNode> |