check-consoles.sh 580B

123456789101112131415161718192021
  1. #!/bin/bash
  2. case $1 in
  3. virtual)
  4. if [ -f /etc/securetty ];then
  5. if grep '^vc/[0-9]' /etc/securetty;then
  6. exit 1
  7. fi
  8. else
  9. exit 0
  10. fi
  11. ;;
  12. serial)
  13. if [ -f "/etc/securetty" ];then
  14. if grep '^ttyS[0-9]' /etc/securetty;then
  15. exit 1
  16. fi
  17. else
  18. exit 0
  19. fi
  20. ;;
  21. esac