diff options
author | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-19 11:26:15 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@sydney.vyatta.com> | 2007-10-19 11:26:15 -0700 |
commit | 07183520f3f4d2f89e526055db418046d0d2450f (patch) | |
tree | 7968eac48a0a57ff97ec4769d999bf31348a2a12 /templates/system/domain-name | |
parent | 66b621cf7759c3448ae8bfe7d7479fb13ea04b65 (diff) | |
download | vyatta-cfg-system-07183520f3f4d2f89e526055db418046d0d2450f.tar.gz vyatta-cfg-system-07183520f3f4d2f89e526055db418046d0d2450f.zip |
move "system" configuration templates/scripts from vyatta-cfg.
Diffstat (limited to 'templates/system/domain-name')
-rw-r--r-- | templates/system/domain-name/node.def | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/system/domain-name/node.def b/templates/system/domain-name/node.def new file mode 100644 index 00000000..8f9d4579 --- /dev/null +++ b/templates/system/domain-name/node.def @@ -0,0 +1,15 @@ +type: txt +help: "Configure system domain name" +syntax: pattern $(@) "^[-a-zA-Z0-9.]{0,63}$" ; "invalid domain name $(@)" +create: "sh -c \"if [ x$(@) == x ]; then exit 0; fi && \ +touch /etc/resolv.conf && \ +sed -i '/domain/d' /etc/resolv.conf && \ +echo \\\"domain\t $(@)\\\" >> /etc/resolv.conf\" " +# also add localhost line into /etc/hosts (see host-name template)? +update: "sh -c \"if [ x$(@) == x ]; then exit 0; fi && \ +touch /etc/resolv.conf && \ +sed -i '/domain/d' /etc/resolv.conf && \ +echo \\\"domain\t $(@)\\\" >> /etc/resolv.conf\" " +# also update localhost line in /etc/hosts (see host-name template)? +delete: "sh -c \"touch /etc/resolv.conf && \ +sed -i '/domain\\\\t $(@)/d' /etc/resolv.conf\" " |