diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-09 21:44:34 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-03-09 21:44:34 +0100 |
commit | e06e5b914cd0b51848d9b836467f49b99cfe40cc (patch) | |
tree | 62ed7fc2bfde51084d5a9439c4806a9603513893 /interface-definitions | |
parent | dfdbcb4e52ab67892c7dc50d6e82b1b7aef8eeb2 (diff) | |
download | vyos-1x-e06e5b914cd0b51848d9b836467f49b99cfe40cc.tar.gz vyos-1x-e06e5b914cd0b51848d9b836467f49b99cfe40cc.zip |
console-server: T3382: proper check for existence of /dev/serial/by-bus
The completion helper was directly called on the /dev/serial/by-bus directory,
but it was not verified if the directory exists at all.
Diffstat (limited to 'interface-definitions')
-rw-r--r-- | interface-definitions/service_console-server.xml.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/interface-definitions/service_console-server.xml.in b/interface-definitions/service_console-server.xml.in index 59a9fe237..5905afe58 100644 --- a/interface-definitions/service_console-server.xml.in +++ b/interface-definitions/service_console-server.xml.in @@ -13,7 +13,7 @@ <help>System serial interface name (ttyS or ttyUSB)</help> <completionHelp> <script>ls -1 /dev | grep ttyS</script> - <script>ls -1 /dev/serial/by-bus</script> + <script>if [ -d /dev/serial/by-bus ]; then ls -1 /dev/serial/by-bus; fi</script> </completionHelp> <valueHelp> <format>ttySxxx</format> @@ -36,7 +36,7 @@ <list>300 1200 2400 4800 9600 19200 38400 57600 115200</list> </completionHelp> <constraint> - <regex>(300|1200|2400|4800|9600|19200|38400|57600|115200)</regex> + <regex>^(300|1200|2400|4800|9600|19200|38400|57600|115200)$</regex> </constraint> </properties> </leafNode> @@ -47,7 +47,7 @@ <list>7 8</list> </completionHelp> <constraint> - <regex>(7|8)</regex> + <validator name="numeric" argument="--range 7-8"/> </constraint> </properties> <defaultValue>8</defaultValue> @@ -59,7 +59,7 @@ <list>1 2</list> </completionHelp> <constraint> - <regex>(1|2)</regex> + <validator name="numeric" argument="--range 1-2"/> </constraint> </properties> <defaultValue>1</defaultValue> @@ -71,7 +71,7 @@ <list>even odd none</list> </completionHelp> <constraint> - <regex>(even|odd|none)</regex> + <regex>^(even|odd|none)$</regex> </constraint> </properties> <defaultValue>none</defaultValue> |