2006-10-05 04:05:48 +08:00
|
|
|
#!/bin/sh /etc/rc.common
|
2010-07-19 02:36:12 +08:00
|
|
|
# Copyright (C) 2006-2010 OpenWrt.org
|
2007-05-10 18:38:53 +08:00
|
|
|
START=50
|
2006-06-27 08:36:13 +08:00
|
|
|
|
2010-07-19 02:36:12 +08:00
|
|
|
has_root_pwd() {
|
|
|
|
local pwd=$([ -f "$1" ] && cat "$1")
|
|
|
|
pwd="${pwd#*root:}"
|
|
|
|
pwd="${pwd%%:*}"
|
|
|
|
|
|
|
|
test -n "${pwd#!}"
|
|
|
|
}
|
|
|
|
|
2006-10-05 04:05:48 +08:00
|
|
|
start() {
|
2010-07-19 02:36:12 +08:00
|
|
|
if ( ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
|
|
|
|
( [ ! -x /usr/sbin/dropbear ] && [ ! -x /usr/sbin/sshd ] );
|
|
|
|
then
|
2009-04-04 17:35:55 +08:00
|
|
|
telnetd -l /bin/login.sh
|
2007-01-09 05:31:29 +08:00
|
|
|
fi
|
2006-10-05 04:05:48 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2010-07-19 02:36:12 +08:00
|
|
|
killall telnetd 2>/dev/null
|
2006-10-05 04:05:48 +08:00
|
|
|
}
|
2010-07-19 02:36:12 +08:00
|
|
|
|