check-root-uid.sh 258B

1234567891011
  1. #!/bin/bash
  2. if [ $(awk -F: '($3 == 0) {print}' /etc/passwd | wc -l) -gt 1 ];then
  3. exit 1
  4. else
  5. if [ "$(awk -F: '($3 == 0) {print}' /etc/passwd | awk -F ':' '{printf $1}')" == "root" ];then
  6. exit 0
  7. else
  8. exit 1
  9. fi
  10. fi