diff options
author | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2005-05-13 13:49:48 +0000 |
---|---|---|
committer | mbm <mbm@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2005-05-13 13:49:48 +0000 |
commit | 9313b904536d595361703f559e34d16bc6412611 (patch) | |
tree | fbad2e14e6a387144ccce3307653c9c8f7ce0f43 /openwrt/target/default/target_skeleton/bin/login | |
parent | f9b510327c4185d3a17a85858c6cc68d4b6f8303 (diff) |
cleanup login script, change firewall example
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@881 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'openwrt/target/default/target_skeleton/bin/login')
-rwxr-xr-x | openwrt/target/default/target_skeleton/bin/login | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/openwrt/target/default/target_skeleton/bin/login b/openwrt/target/default/target_skeleton/bin/login index 238e971aaf..bb065e54a1 100755 --- a/openwrt/target/default/target_skeleton/bin/login +++ b/openwrt/target/default/target_skeleton/bin/login @@ -1,21 +1,20 @@ #!/bin/sh -[ "$FAILSAFE" = "true" ] && exec /bin/ash --login - -[ -f /etc/sysconf ] && . /etc/sysconf - -if [ "$BR2_SYSCONF_TELNET_FAILSAFE_ONLY" = "y" ]; then - if grep '^root:!' /etc/passwd > /dev/null 2>/dev/null; then - echo "You need to set a login password to protect your" - echo "Router from unauthorized access." - echo - echo "Use 'passwd' to set your password." - echo "telnet login will be disabled afterwards," - echo "You can then login using SSH." - echo - else - echo "Login failed." - exit 0 - fi -fi +. /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 |