1
0

99_10_failsafe_login 479 B

123456789101112131415161718
  1. #!/bin/sh
  2. # Copyright (C) 2006-2015 OpenWrt.org
  3. # Copyright (C) 2010 Vertical Communications
  4. failsafe_netlogin () {
  5. dropbearkey -t rsa -s 1024 -f /tmp/dropbear_failsafe_host_key
  6. dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
  7. }
  8. failsafe_shell() {
  9. lock /tmp/.failsafe
  10. ash --login
  11. echo "Please reboot system when done with failsafe network logins"
  12. while true; do sleep 1; done
  13. }
  14. boot_hook_add failsafe failsafe_netlogin
  15. boot_hook_add failsafe failsafe_shell