base-files: Allow to disable failsafe mode
[openwrt/openwrt.git] / package / base-files / files / bin / login.sh
index 6682b022bad6ff314c36c5b0c0af916227c7bc2b..754d29085762437fc976bc2b2d1531c34b35c473 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Copyright (C) 2006-2011 OpenWrt.org
 
-if ( ! grep -qs '^root::' /etc/shadow || \
-     ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
+if ( ! grep -qsE '^root:[!x]?:' /etc/shadow || \
+     ! grep -qsE '^root:[!x]?:' /etc/passwd ) && \
    [ -z "$FAILSAFE" ]
 then
        echo "Login failed."
@@ -10,8 +10,7 @@ then
 else
 cat << EOF
  === IMPORTANT ============================
-  Use 'passwd' to set your login password
-  this will disable telnet and enable SSH
+  Use 'passwd' to set your login password!
  ------------------------------------------
 EOF
 fi