aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/bin/login.sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2009-04-04 09:35:55 +0000
committerFelix Fietkau <nbd@openwrt.org>2009-04-04 09:35:55 +0000
commitde0332f86a7d2017246a6c78ddad480005912e59 (patch)
tree9746171896c3d5ee4759394edf0bdab4d8531386 /package/base-files/files/bin/login.sh
parent714ffa32608e47de9260b1e950b9a74ca3a78da7 (diff)
downloadupstream-de0332f86a7d2017246a6c78ddad480005912e59.tar.gz
upstream-de0332f86a7d2017246a6c78ddad480005912e59.tar.bz2
upstream-de0332f86a7d2017246a6c78ddad480005912e59.zip
rename our /bin/login script to /bin/login.sh to avoid collisions with busybox - we always use -l on telnetd anyway
SVN-Revision: 15097
Diffstat (limited to 'package/base-files/files/bin/login.sh')
-rwxr-xr-xpackage/base-files/files/bin/login.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/package/base-files/files/bin/login.sh b/package/base-files/files/bin/login.sh
new file mode 100755
index 0000000000..ff5d3660e4
--- /dev/null
+++ b/package/base-files/files/bin/login.sh
@@ -0,0 +1,18 @@
+#!/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