summaryrefslogtreecommitdiff
path: root/interface-definitions/host-name.xml
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-05-16 07:40:54 +0200
committerDaniil Baturin <daniil@baturin.org>2018-05-16 07:40:54 +0200
commitb6810edc7c31b171116c8ab87b3a25bee5727b7c (patch)
treee74dd7be4777e5c0af8c2dc5fee8a7f385ad555d /interface-definitions/host-name.xml
parentf34d968e942c29ab9eae881cc5486d743cfee08a (diff)
downloadvyos-1x-b6810edc7c31b171116c8ab87b3a25bee5727b7c.tar.gz
vyos-1x-b6810edc7c31b171116c8ab87b3a25bee5727b7c.zip
T574: fix the hostname configuration script and add the domain-name command.
Fix multiple syntax errors. Restart rsyslog after update since it uses the hostname. Write the 127.0 entry to /etc/hosts, since sudo complains when it cannot resolve it.
Diffstat (limited to 'interface-definitions/host-name.xml')
-rw-r--r--interface-definitions/host-name.xml24
1 files changed, 14 insertions, 10 deletions
diff --git a/interface-definitions/host-name.xml b/interface-definitions/host-name.xml
index 1452a956a..4ab244f6a 100644
--- a/interface-definitions/host-name.xml
+++ b/interface-definitions/host-name.xml
@@ -5,18 +5,22 @@
<interfaceDefinition>
<node name="system">
<children>
- <node name="host-name" owner="${vyos_sbindir}/vyos-config-host-name.py">
+ <leafNode name="host-name" owner="${vyos_sbindir}/vyos-config-host-name.py">
<properties>
<help>System host name (default: vyos)</help>
+ <constraint>
+ <regex>[A-Za-z0-9][-.A-Za-z0-9]*[A-Za-z0-9]</regex>
+ </constraint>
</properties>
- <children>
- <leafNode name="hostname">
- <properties>
- <help>System host name (default: vyos)</help>
- </properties>
- </leafNode>
- </children>
- </node>
+ </leafNode>
+ <leafNode name="domain-name" owner="${vyos_sbindir}/vyos-config-host-name.py">
+ <properties>
+ <help>System domain name</help>
+ <constraint>
+ <regex>[A-Za-z0-9][-.A-Za-z0-9]*</regex>
+ </constraint>
+ </properties>
+ </leafNode>
</children>
</node>
-</interfaceDefinition> \ No newline at end of file
+</interfaceDefinition>