#!/bin/sh
MAIL_ADDRESS=" "
a=`chage -l siebel|grep Password|grep expires`
b=$((`date "+%s" -d "${a#*: }"` - `date "+%s"`))
c=$((b / 86400))
d=`env|grep HOSTNAME`
e=259200
f=`env|grep USER`
if (( b > c )) ;then
echo `date` "login pass: your password will expire in ${c} days" >> login_ok.log
else
echo `date` "login fail: your password will expire in ${c} days" >> login_fail.log
echo "Warning: ${f#*=}'s password will expire in ${c} days" |mailx -s "${f#*=}'s password will expire on ${d#*=}.corp.novocorp.net" $MAIL_ADDRESS
fi
MAIL_ADDRESS=" "
a=`chage -l siebel|grep Password|grep expires`
b=$((`date "+%s" -d "${a#*: }"` - `date "+%s"`))
c=$((b / 86400))
d=`env|grep HOSTNAME`
e=259200
f=`env|grep USER`
if (( b > c )) ;then
echo `date` "login pass: your password will expire in ${c} days" >> login_ok.log
else
echo `date` "login fail: your password will expire in ${c} days" >> login_fail.log
echo "Warning: ${f#*=}'s password will expire in ${c} days" |mailx -s "${f#*=}'s password will expire on ${d#*=}.corp.novocorp.net" $MAIL_ADDRESS
fi