summaryrefslogtreecommitdiff
path: root/packages/busybox/files/50telnet
blob: 3fb4a90494cc4e1bb8537e6d71ace7891855fafe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
}