[ CA ControlMinder password expired check ]
if [ ! -z "$PID" ]; then
#C=`/usr/seos/bin/segrace -d 7 |wc -l`
C1=`/usr/seos/bin/segrace -d 7 <<ENDSEG
ENDSEG`
# INTERVAL : in case of password not expirded
# STILL : in case of password expired but allowed grace login
# NOLEFT : in case of last grace login
INTERVAL=`echo $C1|grep interval|awk '{print $7}'`
STILL=`echo $C1|grep still|awk '{print $9}'`
NOLEFT=`echo $C1|grep Change|awk '{print $7}'`
C=`echo $C1|wc -l`
if [ $C != 0 ]; then
clear
echo "####################################################################"
echo "# #"
echo "# ##### ## #### #### # # #### ##### ##### #"
echo "# # # # # # # # # # # # # # # #"
echo "# # # # # #### #### # # # # # # # # #"
echo "# ##### ###### # # # ## # # # ##### # # #"
echo "# # # # # # # # ## ## # # # # # # #"
echo "# # # # #### #### # # #### # # ##### #"
echo "#------------------------------------------------------------------#"
if [ ! -z "$INTERVAL" ]; then
/usr/seos/bin/segrace -d 7|head -1|awk '{print "# Password should be changed in [ "$7 " ] days. #"}'
elif [ ! -z "$STILL" ]; then
/usr/seos/bin/segrace -d 7|grep time|awk '{print "# Your password has expired. You can still login [ "$5" ] times. #"}'
elif [ ! -z "$NOLEFT" ]; then
echo "# Your password should be changed today. Change your password. No more login if not. #"
fi
echo "#------------------------------------------------------------------#"
echo "# Password rules (length=8 or greater, alpha=4, lower=2, special=2) #"
echo "####################################################################"
menustop=0
while [ $menustop = 0 ]
do
echo "Would you like to change your password now ? (Y/N) : Default Yes ==>"
read inp
case $inp in
N|n)
menustop=1
;;
*)
menustop=1
#banner passwd change
echo "You chosed to change it. change your password."
passwd
;;
esac
done
fi
fi
No comments:
Post a Comment