3 # $NetBSD: skeyaudit.sh,v 1.3 2000/07/07 15:19:09 mjl Exp $
5 # This script will look thru the skeykeys file for
6 # people with sequence numbers less than LOWLIMIT=12
7 # and send them an e-mail reminder to use skeyinit soon
16 SUBJECT
="Reminder: Run skeyinit"
25 if [ ! -s "${KEYDB}" ]; then
29 # an skeykeys entry looks like
30 # jsw 0076 la13079 ba20a75528de9d3a
31 # #oot md5 0005 aspa26398 9432d570ff4421f0 Jul 07,2000 01:36:43
32 # mjl sha1 0099 alpha2 459a5dac23d20a90 Jul 07,2000 02:14:17
33 # the sequence number is the second (or third) entry
36 SKEYS
=`$AWK '/^#/ {next} {if($2 ~ /^[0-9]+$/) print $1,$2,$3; else print $1,$3,$4; }' $KEYDB`
40 while [ "X$1" != "X" ]; do
45 # echo "$USER -- $SEQ -- $KEY"
46 if [ $SEQ -lt $LOWLIMIT ]; then
47 if [ $SEQ -lt 3 ]; then
48 SUBJECT
="IMPORTANT action required"
51 $ECHO "You are nearing the end of your current S/Key sequence for account $i"
52 $ECHO "on system $HOST."
54 $ECHO "Your S/key sequence number is now $SEQ. When it reaches zero you"
55 $ECHO "will no longer be able to use S/Key to login into the system. "
57 $ECHO "Use \"skeyinit -s\" to reinitialize your sequence number."
59 ) |
/usr
/bin
/Mail
-s "$SUBJECT" $USER $ADMIN