check-netrc.sh 432B

1234567891011121314151617
  1. #!/bin/bash
  2. if [ -f ~/.netrc ];then
  3. echo "Found .netrc in /root"
  4. exit 1
  5. else
  6. echo ".netrc no found in /root"
  7. fi
  8. for i in $(awk -F':' '{ if ( $3 >= 500 ) print $1 }' /etc/passwd);do
  9. HOMEDIR=`eval "echo ~$i"`
  10. if [ -f "$HOMEDIR/.netrc" ];then
  11. echo "Found .netrc in $HOMEDIR"
  12. exit 1
  13. else
  14. echo ".netrc no found in $HOMEDIR"
  15. fi
  16. done