diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-10 17:58:23 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-10 17:58:23 -0800 |
commit | dd8813677e1864d8fe45db79c9fa6392dfe3f245 (patch) | |
tree | 7cd83db5d7bfca8a5bd4e545ffd56fffd790716b /templates/service | |
parent | 5ba8cf8393030d75c03a15551a57831f3f0908a4 (diff) | |
download | vyatta-cfg-quagga-dd8813677e1864d8fe45db79c9fa6392dfe3f245.tar.gz vyatta-cfg-quagga-dd8813677e1864d8fe45db79c9fa6392dfe3f245.zip |
fix for bug 2524: telnet settings can only be set via ssh or console.
Diffstat (limited to 'templates/service')
-rw-r--r-- | templates/service/telnet/node.def | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/templates/service/telnet/node.def b/templates/service/telnet/node.def index 5f4c1c7c..844aec98 100644 --- a/templates/service/telnet/node.def +++ b/templates/service/telnet/node.def @@ -1,4 +1,18 @@ help: "Enable/disable telnet protocol" -delete: "sudo /opt/vyatta/sbin/telnetd.init stop" -end: "if [ -z \"$(port/@)\" ]; then exit 0; fi; \ - sudo /opt/vyatta/sbin/telnetd.init restart $(port/@)" +delete: " \ + 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; \ + sudo /opt/vyatta/sbin/telnetd.init stop" +end: " \ + 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/@)" |