diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/system/domain-name/node.def | 2 | ||||
-rw-r--r-- | templates/system/host-name/node.def | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/templates/system/domain-name/node.def b/templates/system/domain-name/node.def index e5d5af7e..87f9e0fa 100644 --- a/templates/system/domain-name/node.def +++ b/templates/system/domain-name/node.def @@ -3,7 +3,7 @@ type: txt help: System domain name # Allow letter-number-hyphen in label (but can not start or end with hyphen) -syntax:expression: pattern $VAR(@) "^[a-zA-Z0-9](([-a-zA-Z0-9]*[a-zA-Z0-9])?\.)*[a-zA-Z]+$" ; "invalid domain name $VAR(@)" +syntax:expression: exec "/opt/vyatta/sbin/vyatta_check_domainname.pl $VAR(../host-name).$VAR(@)" # also add localhost line into /etc/hosts (see host-name template)? update: sudo /opt/vyatta/sbin/vyatta_update_resolv.pl diff --git a/templates/system/host-name/node.def b/templates/system/host-name/node.def index df266fad..8c733b9f 100644 --- a/templates/system/host-name/node.def +++ b/templates/system/host-name/node.def @@ -4,6 +4,9 @@ help: System host name (default: vyatta) default: "vyatta" syntax:expression: pattern $VAR(@) "^[[:alnum:]][-.[:alnum:]]*[[:alnum:]]$" ; "invalid host name $VAR(@)" + +syntax:expression: pattern $VAR(@) "^.{1,63}$" ; "invalid host-name length" + update: sudo sh -c " \ hostname '$VAR(@)' echo '$VAR(@)' > /etc/hostname |