1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2006-2011 OpenWrt.org
10 local pwd=$([ -f "$1" ] && cat "$1")
14 test -n "${pwd#[\!x]}"
18 local homedir=$([ -f "$1" ] && cat "$1")
19 homedir="${homedir#*:*:0:0:*:}"
25 ( /etc/init.d/dropbear enabled 2> /dev/null && grep -qs "^ssh-" /etc/dropbear/authorized_keys ) || \
26 ( /etc/init.d/sshd enabled 2> /dev/null && grep -qs "^ssh-" "$(get_root_home /etc/passwd)"/.ssh/authorized_keys )
30 if ( ! has_ssh_pubkey && \
31 ! has_root_pwd /etc/passwd && ! has_root_pwd /etc/shadow ) || \
32 ( ! /etc/init.d/dropbear enabled 2> /dev/null && ! /etc/init.d/sshd enabled 2> /dev/null );
35 procd_set_param command "$PROG" -F -l /bin/login.sh