Below coed can be save as in file as lock.sh
#cat >lock.sh
Then run as hs or ksh
#ksh lock.sh
-----------------------------Start of file ------------------------------------------
for i in ` cat /etc/passwd | cut -d":" -f1`
do
lockout=`/usr/lbin/getprpw -m lockout $i`
LOCK=`echo $lockout |cut -c14`
if [[ $LOCK = 1 ]]
then
echo "--------------------user $i is locked -------------"
else
echo " --------------------user $i is not locked -----------$i"
fi
done
-----------------------------End of file ----------------------------------------------
#cat >lock.sh
Then run as hs or ksh
#ksh lock.sh
-----------------------------Start of file ------------------------------------------
for i in ` cat /etc/passwd | cut -d":" -f1`
do
lockout=`/usr/lbin/getprpw -m lockout $i`
LOCK=`echo $lockout |cut -c14`
if [[ $LOCK = 1 ]]
then
echo "--------------------user $i is locked -------------"
else
echo " --------------------user $i is not locked -----------$i"
fi
done
-----------------------------End of file ----------------------------------------------
No comments:
Post a Comment