check-depends.sh 1.2KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. case $1 in
  3. smb-signing)
  4. if dpkg -s samba >/dev/null 2>&1;then
  5. if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' -e '/^;/d' /etc/samba/smb.conf | grep "client.*signing.*mandatory";then
  6. exit 1
  7. fi
  8. fi
  9. ;;
  10. smb-sec)
  11. if [ "$(grep "cifs.*sec=krb5a\|cifs.*sec=ntlmv2i" /etc/mtab /etc/fstab | wc -l)" != "$(grep "cifs" /etc/mtab /etc/fstab | wc -l)" ];then
  12. exit 1
  13. fi
  14. ;;
  15. libuser)
  16. if [ -f /etc/libuser.conf ];then
  17. if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/libuser.conf | grep "crypt_style.*sha512";then
  18. exit 1
  19. fi
  20. fi
  21. ;;
  22. icmpv6)
  23. if [ -a /proc/net/if_inet6 ];then
  24. if ! sed -e '/^#/d' -e '/^[ \t][ \t]*#/d' -e 's/#.*$//' -e '/^$/d' /etc/libuser.conf | grep "crypt_style.*sha512";then
  25. exit 1
  26. fi
  27. fi
  28. ;;
  29. esac