From 622bbf801bd435a3848c669ff2c0e9090cd2bb4e Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 31 Jan 2008 07:59:02 -0800 Subject: convert templates to new syntax --- templates/service/node.def | 2 +- templates/service/ssh/node.def | 14 +++++++------- templates/service/ssh/port/node.def | 2 +- templates/service/ssh/protocol-version/node.def | 2 +- templates/service/telnet/allow-root/node.def | 8 ++++---- templates/service/telnet/node.def | 10 +++++----- templates/service/telnet/port/node.def | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) (limited to 'templates/service') diff --git a/templates/service/node.def b/templates/service/node.def index 11eb1b83..f2dbf0c6 100644 --- a/templates/service/node.def +++ b/templates/service/node.def @@ -1 +1 @@ -help: "Service configuration" +help: Service configuration diff --git a/templates/service/ssh/node.def b/templates/service/ssh/node.def index 17e9b3dd..a16f5d15 100644 --- a/templates/service/ssh/node.def +++ b/templates/service/ssh/node.def @@ -1,17 +1,17 @@ -help: "Enable/disable SSH protocol" -delete: "sudo /usr/sbin/invoke-rc.d ssh stop && \ +help: Enable/disable SSH protocol +delete:expression: "sudo /usr/sbin/invoke-rc.d ssh stop && \ sudo sh -c \"echo 'SSHD_OPTS=' > /etc/default/ssh\" " -end: "if [ -z \"$(port/@)\" ]; then exit 0; fi; \ +end:expression: "if [ -z \"$VAR(port/@)\" ]; then exit 0; fi; \ sudo sh -c \ \"[ -f /etc/ssh/ssh_host_key ] \ || sudo ssh-keygen -t rsa1 -N '' -f /etc/ssh/ssh_host_key\"; \ - case \"$(protocol-version/@)\" in \ + case \"$VAR(protocol-version/@)\" in \ v2) VER=2;; \ v1) VER=1;; \ all) VER=\"1,2\";; \ *) VER=2;; \ esac; \ - STR=\"SSHD_OPTS=\\\"-p $(port/@) -o HostKey=/etc/ssh/ssh_host_key \ --o Protocol=\\\${VER}\\\"\"; \ - sudo sh -c \"echo '\\\$STR' > /etc/default/ssh\"; \ + STR=\"SSHD_OPTS=\\\"-p $VAR(port/@) -o HostKey=/etc/ssh/ssh_host_key \ +-o Protocol=${VER}\\\"\"; \ + sudo sh -c \"echo '$STR' > /etc/default/ssh\"; \ sudo /usr/sbin/invoke-rc.d ssh restart" diff --git a/templates/service/ssh/port/node.def b/templates/service/ssh/port/node.def index ae388cc9..1b1248f4 100644 --- a/templates/service/ssh/port/node.def +++ b/templates/service/ssh/port/node.def @@ -1,3 +1,3 @@ type: u32 default: 22 -help: "Port for SSH service" +help: Port for SSH service diff --git a/templates/service/ssh/protocol-version/node.def b/templates/service/ssh/protocol-version/node.def index ccf98c74..a4efc602 100644 --- a/templates/service/ssh/protocol-version/node.def +++ b/templates/service/ssh/protocol-version/node.def @@ -1,3 +1,3 @@ type: txt default: "v2" -help: "SSH version" +help: SSH version diff --git a/templates/service/telnet/allow-root/node.def b/templates/service/telnet/allow-root/node.def index 9c3ff97d..d1a25f4e 100644 --- a/templates/service/telnet/allow-root/node.def +++ b/templates/service/telnet/allow-root/node.def @@ -1,19 +1,19 @@ type: bool default: false -help: "Enable/disable root login" -update: " \ +help: Enable/disable root login +update:expression: " \ if ! env | grep -q SSH_TTY=; then \ if [[ \"`tty`\" == /dev/pts/* ]]; then \ echo \"Please configure telnet settings via ssh or console.\"; \ exit 1; \ fi; \ fi; \ - if [ \"$(@)\" == \"true\" ]; then \ + if [ \"$VAR(@)\" == \"true\" ]; then \ sudo mv -f /etc/securetty /etc/securetty.allow-root >&/dev/null; \ else sudo mv -f /etc/securetty.allow-root /etc/securetty >&/dev/null; \ fi ; /bin/true" -delete: " \ +delete:expression: " \ if ! env | grep -q SSH_TTY=; then \ if [[ \"`tty`\" == /dev/pts/* ]]; then \ echo \"Please configure telnet settings via ssh or console.\"; \ diff --git a/templates/service/telnet/node.def b/templates/service/telnet/node.def index 844aec98..a1cc9680 100644 --- a/templates/service/telnet/node.def +++ b/templates/service/telnet/node.def @@ -1,5 +1,5 @@ -help: "Enable/disable telnet protocol" -delete: " \ +help: Enable/disable telnet protocol +delete:expression: " \ if ! env | grep -q SSH_TTY=; then \ if [[ \"`tty`\" == /dev/pts/* ]]; then \ echo \"Please configure telnet settings via ssh or console.\"; \ @@ -7,12 +7,12 @@ delete: " \ fi; \ fi; \ sudo /opt/vyatta/sbin/telnetd.init stop" -end: " \ +end:expression: " \ if ! env | grep -q SSH_TTY=; then \ if [[ \"`tty`\" == /dev/pts/* ]]; then \ echo \"Please configure telnet settings via ssh or console.\"; \ exit 1; \ fi; \ fi; \ - if [ -z \"$(port/@)\" ]; then exit 0; fi; \ - sudo /opt/vyatta/sbin/telnetd.init restart $(port/@)" + if [ -z \"$VAR(port/@)\" ]; then exit 0; fi; \ + sudo /opt/vyatta/sbin/telnetd.init restart $VAR(port/@)" diff --git a/templates/service/telnet/port/node.def b/templates/service/telnet/port/node.def index d9bbce6c..81b2ff91 100644 --- a/templates/service/telnet/port/node.def +++ b/templates/service/telnet/port/node.def @@ -1,3 +1,3 @@ type: u32 default: 23 -help: "Port for telnet service" +help: Port for telnet service -- cgit v1.2.3