summaryrefslogtreecommitdiff
path: root/openwrt/package/base-files/default/bin/login
blob: bb065e54a1bfcec7e6a5e1f7fdb7eaba2dd08c1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
. /etc/sysconf 2>&-

[ "$FAILSAFE" != "true" ] &&
[ "$BR2_SYSCONF_TELNET_FAILSAFE_ONLY" = "y" ] &&
{
  grep '^root:[^!]' /etc/passwd >&- 2>&- &&
  {
    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