login.sh 418 B

12345678910111213141516171819
  1. #!/bin/sh
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. if ( ! grep -qs '^root::' /etc/shadow || \
  4. ! grep -qs '^root:[!x]\?:' /etc/passwd ) && \
  5. [ -z "$FAILSAFE" ]
  6. then
  7. echo "Login failed."
  8. exit 0
  9. else
  10. cat << EOF
  11. === IMPORTANT ============================
  12. Use 'passwd' to set your login password
  13. this will disable telnet and enable SSH
  14. ------------------------------------------
  15. EOF
  16. fi
  17. exec /bin/ash --login