12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #!/bin/bash
  2. case $1 in
  3. atd)
  4. if service --status-all | grep "+.*atd";then
  5. exit 1
  6. fi
  7. ;;
  8. avahi-daemon)
  9. if service --status-all | grep "+.*avahi-daemon";then
  10. exit 1
  11. fi
  12. ;;
  13. xinetd)
  14. if service --status-all | grep "+.*xinetd";then
  15. exit 1
  16. fi
  17. ;;
  18. telnetd)
  19. if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep telnet;then
  20. exit 1
  21. fi
  22. ;;
  23. rshd)
  24. if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rshd;then
  25. exit 1
  26. fi
  27. ;;
  28. rexecd)
  29. if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rexecd;then
  30. exit 1
  31. fi
  32. ;;
  33. rlogind)
  34. if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep rlogind;then
  35. exit 1
  36. fi
  37. ;;
  38. nis)
  39. if service --status-all | grep "+.*\ nis$";then
  40. exit 1
  41. fi
  42. ;;
  43. tftpd)
  44. if sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/inetd.conf | grep tftpd;then
  45. exit 1
  46. fi
  47. ;;
  48. cron)
  49. if ! service --status-all | grep "+.*cron";then
  50. exit 1
  51. fi
  52. ;;
  53. ntp)
  54. if ! service --status-all | grep "+.*ntp";then
  55. exit 1
  56. fi
  57. ;;
  58. postfix)
  59. if ! service --status-all | grep "+.*postfix";then
  60. exit 1
  61. fi
  62. ;;
  63. x11-common)
  64. if service --status-all | grep "+.*x11-common";then
  65. exit 1
  66. fi
  67. ;;
  68. bluetooth)
  69. if service --status-all | grep "+.*bluetooth";then
  70. exit 1
  71. fi
  72. ;;
  73. autofs)
  74. if service --status-all | grep "+.*autofs";then
  75. exit 1
  76. fi
  77. ;;
  78. esac