user-list.sh 738 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. echo "-------------------------------" | lolcat
  3. echo "USERNAME EXP DATE " | lolcat
  4. echo "-------------------------------" | lolcat
  5. while read expired
  6. do
  7. AKUN="$(echo $expired | cut -d: -f1)"
  8. ID="$(echo $expired | grep -v nobody | cut -d: -f3)"
  9. exp="$(chage -l $AKUN | grep "Account expires" | awk -F": " '{print $2}')"
  10. if [[ $ID -ge 1000 ]]; then
  11. printf "%-17s %2s\n" "$AKUN" "$exp"
  12. fi
  13. done < /etc/passwd
  14. JUMLAH="$(awk -F: '$3 >= 1000 && $1 != "nobody" {print $1}' /etc/passwd | wc -l)"
  15. echo "-------------------------------" | lolcat
  16. echo "Account number: $JUMLAH user"
  17. echo "-------------------------------" | lolcat
  18. echo -e "Mod by Janda Baper Group"
  19. echo -e ""