check-libs-mode.sh 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/bash
  2. if [ -d "/lib" ];then
  3. COUNT=$(find -L /lib -type f -perm /022 -exec ls -l {} \; |wc -l)
  4. if [ $COUNT -eq 0 ];then
  5. :
  6. else
  7. find -L /lib -type f -perm /022 -exec ls -l {} \;
  8. exit 1
  9. fi
  10. fi
  11. if [ -d "/lib64" ];then
  12. COUNT=$(find -L /lib64 -type f -perm /022 -exec ls -l {} \; |wc -l)
  13. if [ $COUNT -eq 0 ];then
  14. :
  15. else
  16. find -L /lib64 -type f -perm /022 -exec ls -l {} \;
  17. exit 1
  18. fi
  19. fi
  20. if [ -d "/usr/lib" ];then
  21. COUNT=$(find -L /usr/lib -type f -perm /022 -exec ls -l {} \; |wc -l)
  22. if [ $COUNT -eq 0 ];then
  23. :
  24. else
  25. find -L /usr/lib -type f -perm /022 -exec ls -l {} \;
  26. exit 1
  27. fi
  28. fi
  29. if [ -d "/usr/lib64" ];then
  30. COUNT=$(find -L /usr/lib64 -type f -perm /022 -exec ls -l {} \; |wc -l)
  31. if [ $COUNT -eq 0 ];then
  32. :
  33. else
  34. find -L /usr/lib64 -type f -perm /022 -exec ls -l {} \;
  35. exit 1
  36. fi
  37. fi
  38. exit 0