summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-15 14:11:09 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-10-15 14:11:09 -0700
commitb48beb78f51cea17ff967ad693d2380030e629af (patch)
treed04fd13ae8d0ed2bfd42c5739eef64b9ffe8f695
parent540cf454c6f7a5595a0fce42906f2656dc10cc9f (diff)
downloadvyatta-cfg-system-b48beb78f51cea17ff967ad693d2380030e629af.tar.gz
vyatta-cfg-system-b48beb78f51cea17ff967ad693d2380030e629af.zip
Fix parsing of allow-root field
Bugfix 3795 The field is boolean and was failing during bootup. Rework to use sed and do it the simple way
-rw-r--r--templates/service/ssh/allow-root/node.def18
1 files changed, 5 insertions, 13 deletions
diff --git a/templates/service/ssh/allow-root/node.def b/templates/service/ssh/allow-root/node.def
index 9aa98826..21c85e59 100644
--- a/templates/service/ssh/allow-root/node.def
+++ b/templates/service/ssh/allow-root/node.def
@@ -1,16 +1,8 @@
-type: txt
+type: bool
default: false
help: Enable/disable root login over ssh
-syntax:expression: $VAR(@) in "true", "false" ; "must be true or false"
-update: if [ \"$VAR(@)\" == \"true\" ]; then
- sudo ed - /etc/ssh/sshd_config <<-"EOF"
- /^PermitRootLogin/s/no/yes/
- wq
- EOF
- else
- sudo ed - /etc/ssh/sshd_config <<-"EOF"
- /^PermitRootLogin/s/yes/no/
- wq
- EOF
+update: if [ "$VAR(@)" == "true" ];
+ then regex='/^PermitRootLogin/s/no/yes/'
+ else regex='/^PermitRootLogin/s/yes/no/'
fi
- /bin/true
+ sed -i -e "$regex" /etc/ssh/sshd_config