+++ /dev/null
-#!/bin/sh
-# Copyright (C) 2006 OpenWrt.org
-
-grep '^root:[^!]' /etc/passwd >&- 2>&-
-[ "$?" = "0" -a -z "$FAILSAFE" ] &&
-{
- echo "Login failed."
- exit 0
-} || {
-cat << EOF
- === IMPORTANT ============================
- Use 'passwd' to set your login password
- this will disable telnet and enable SSH
- ------------------------------------------
-EOF
-}
-
-exec /bin/ash --login
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2006 OpenWrt.org
+
+grep '^root:[^!]' /etc/passwd >&- 2>&-
+[ "$?" = "0" -a -z "$FAILSAFE" ] &&
+{
+ echo "Login failed."
+ exit 0
+} || {
+cat << EOF
+ === IMPORTANT ============================
+ Use 'passwd' to set your login password
+ this will disable telnet and enable SSH
+ ------------------------------------------
+EOF
+}
+
+exec /bin/ash --login
[ -n "$ifname" ] && grep "$ifname" /proc/net/dev >/dev/null && {
failsafe_ip
netmsg 192.168.1.255 "Entering Failsafe!"
- telnetd -l /bin/login <> /dev/null 2>&1
+ telnetd -l /bin/login.sh <> /dev/null 2>&1
}
lock /tmp/.failsafe
ash --login
awk -F: '/^root:/ && ($2 != "") && ($2 !~ /\!/) {exit 1}' /etc/passwd 2>/dev/null || \
( [ \! -x /usr/sbin/dropbear ] && [ \! -x /usr/sbin/sshd ] )
then \
- telnetd -l /bin/login
+ telnetd -l /bin/login.sh
fi
}
}
netmsg 192.168.1.255 "Entering Failsafe!"
- telnetd -l /bin/login <> /dev/null 2>&1
+ telnetd -l /bin/login.sh <> /dev/null 2>&1
ash --login
}