aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/login.sh
blob: 00f2f81ab421b13dd97ed19793c540ad7f5fd1d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org


regpassresult="0"
grep '^root:[^!]' /etc/passwd >&- 2>&-
regpassresult="$?"
shadowresult="0"
if [ -e "/etc/shadow" ]; then
	grep '^root:[^!]' /etc/shadow >&- 2>&-
        shadowresult="$?"
fi
[ "$regpassresult" = "0" ] && [ "$shadowresult" = "0" ] && [ -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