summaryrefslogtreecommitdiff
path: root/packages/busybox/files/50telnet
diff options
context:
space:
mode:
authorGraeme Gregory <dp@xora.org.uk>2008-03-25 07:34:23 +0000
committerGraeme Gregory <dp@xora.org.uk>2008-03-25 07:34:23 +0000
commit80e765ba6f2c395006d82251bea0b3590b277dff (patch)
treea1af31784e3970f80650ca0af796ab7386362423 /packages/busybox/files/50telnet
parent30670f2daf9a086b47cee18af56265bf8fedaf29 (diff)
parentbc02b41d392b6fce7a50e992de6b5b2234bab183 (diff)
merge of '55b6b2c132d8b0a81bcec0deed383a3da45e39e8'
and '67254ac9ecc3abdbf0b718b05d6eaa8d6b4b6e92'
Diffstat (limited to 'packages/busybox/files/50telnet')
-rw-r--r--packages/busybox/files/50telnet16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/busybox/files/50telnet b/packages/busybox/files/50telnet
new file mode 100644
index 0000000000..3fb4a90494
--- /dev/null
+++ b/packages/busybox/files/50telnet
@@ -0,0 +1,16 @@
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+# Copyright (C) 2008 Koen Kooi
+
+# This starts telnetd if the password for 'root' is empty. This is needed for devices without a screen or serial console (wifi router, NAS, etc).
+
+start() {
+ if awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null
+ then
+ telnetd -l /bin/login.failsafe
+ fi
+}
+
+stop() {
+ killall telnetd
+}