summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2007-10-31 15:22:02 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2007-10-31 15:22:02 -0700
commit61f301fce041eb658d62579879ae6fb355b0cde7 (patch)
tree687e79668ea661077a0a32b26394bd102bc9fe04
parentf0920480f03cd60681061a6bbb19fc70beb235dd (diff)
downloadvyatta-cfg-system-61f301fce041eb658d62579879ae6fb355b0cde7.tar.gz
vyatta-cfg-system-61f301fce041eb658d62579879ae6fb355b0cde7.zip
add telnet service
-rw-r--r--Makefile.am1
-rwxr-xr-xscripts/telnetd.init17
-rw-r--r--templates/service/telnet/node.def4
-rw-r--r--templates/service/telnet/port/node.def3
4 files changed, 9 insertions, 16 deletions
diff --git a/Makefile.am b/Makefile.am
index 2cbb92d1..9f461cbf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,7 @@ sbin_SCRIPTS += scripts/system/vyatta_update_logrotate.pl
sbin_SCRIPTS += scripts/system/vyatta_update_syslog.pl
sbin_SCRIPTS += scripts/vyatta-snmp.pl
sbin_SCRIPTS += scripts/snmpd.init
+sbin_SCRIPTS += scripts/telnetd.init
sysconf_DATA += sysconf/hosts
sysconf_DATA += sysconf/logrotate_messages
diff --git a/scripts/telnetd.init b/scripts/telnetd.init
index 7afefb3d..b8368f03 100755
--- a/scripts/telnetd.init
+++ b/scripts/telnetd.init
@@ -3,21 +3,7 @@
declare progname=${0##*/}
declare action=$1; shift
-if [ x$BOOTFILE != x ] && [ -r $BOOTFILE ]; then
- may_start=false
- eval $(sed -n '
-/^service {$/,/^}$/ {
- / *telnet {$/,/ *}$/ {
- s/ *telnet {/may_start=true/p
- s/ *port: /port=/p
-}}' $BOOTFILE)
-else
- may_start=true
-fi
-
-if [ $# -ne 0 ] ; then
- port=$1; shift
-fi
+port=$1; shift
: ${port:=23}
: ${bb:=/bin/busybox}
@@ -41,7 +27,6 @@ start ()
local -i pid=$( running_pid )
[ $pid -ne 0 ] && return
- $may_start || return 0
$bb telnetd -p $port
}
diff --git a/templates/service/telnet/node.def b/templates/service/telnet/node.def
new file mode 100644
index 00000000..5f4c1c7c
--- /dev/null
+++ b/templates/service/telnet/node.def
@@ -0,0 +1,4 @@
+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/@)"
diff --git a/templates/service/telnet/port/node.def b/templates/service/telnet/port/node.def
new file mode 100644
index 00000000..0232af83
--- /dev/null
+++ b/templates/service/telnet/port/node.def
@@ -0,0 +1,3 @@
+type: u32
+default: 23
+help: "Port for telnet service"