summaryrefslogtreecommitdiffstats
path: root/package/base-files/default/bin/login
diff options
context:
space:
mode:
Diffstat (limited to 'package/base-files/default/bin/login')
-rwxr-xr-xpackage/base-files/default/bin/login20
1 files changed, 20 insertions, 0 deletions
diff --git a/package/base-files/default/bin/login b/package/base-files/default/bin/login
new file mode 100755
index 000000000..bb065e54a
--- /dev/null
+++ b/package/base-files/default/bin/login
@@ -0,0 +1,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