#!/bin/sh ###################################################### # # This little ditty compiles a list of disabled users # # Chuck G # Nov 21, 2000 # ####################################################### if [ -f /etc/passwd ]; then grep "\*" /etc/passwd | cut -f1,5 -d: > tempfile elif [ -f /etc/shadow ]; then grep "\*" /etc/shadow | cut -f1 -d: > tempfile else echo "No shadow or passwd file found!" fi # this next line deletes the first 15 entries because # they are system accounts with no login capability. # right now the number of such accounts is 15. Change # this if the number changes. sed '1,15d' tempfile > tempfile2 sed 's/:/ /g' tempfile2 > tempfile sort tempfile > tempfilesorted echo "FCG DISABLED USERS: TOTAL = `wc -l tempfilesorted` " > tempfile sed 's/tempfilesorted//' tempfile > tempfile2 cat tempfilesorted >> tempfile2 more tempfile2 rm -f tempfile*