summaryrefslogtreecommitdiff
path: root/interface-definitions/interfaces-wirelessmodem.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-06-07 21:02:30 +0200
committerChristian Poessinger <christian@poessinger.com>2020-06-07 21:02:30 +0200
commit4f7e89f03cef469628b73000c4cf97eae6d566a0 (patch)
treea5116dfad5857973b9fef8ec0111683619acbfa4 /interface-definitions/interfaces-wirelessmodem.xml.in
parent7793a14ab682a9b48f799fd4506cbf7ca44bd450 (diff)
downloadvyos-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.
Diffstat (limited to 'interface-definitions/interfaces-wirelessmodem.xml.in')
-rw-r--r--interface-definitions/interfaces-wirelessmodem.xml.in7
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>