1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
7 local pwd=$([ -f "$1" ] && cat "$1")
11 test -n "${pwd#[\!x]}"
15 local homedir=$([ -f "$1" ] && cat "$1")
16 homedir="${homedir#*:*:0:0:*:}"
22 ( /etc/init.d/dropbear enabled 2> /dev/null && grep -qs "^ssh-" /etc/dropbear/authorized_keys ) || \
23 ( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys )
27 if ( ! has_ssh_pubkey && \
28 ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
29 ( ! /etc/init.d/dropbear enabled 2> /dev/null && ! /etc/init.d/sshd enabled 2> /dev/null );
31 service_start /usr/sbin/telnetd -l /bin/login.sh
36 service_stop /usr/sbin/telnetd