Hi Guys,
I am new to this fourm. Need your help to complete my requirment.
Below is my requirment.
Have to check expiry of the certificate. Compare the certificate expiry date with current date. If the difference is less than 30 days, need to send mail.
#!/usr/bin/ksh
file="sslexpiry" #the file where you keep your string expiry date
name=$(cat "$file") #the output of 'cat $file' is assigned to the $name variable
date > todate.ext #the file where you keep current date value
file1="todate.ext" #the file where you keep your string current date
todaydate=$(cat "$file1") #the output of 'cat $file1' is assigned to the $todaydate variable
echo $name
echo $todaydate
---
I can print the dates as below
Fri Apr 10 18:59:59 CDT 2015
Thu Feb 19 18:50:52 CST 2015
--
Now i have to count the number of days between these two dates. After that need to sent mail if this value is less than 30.
Could you please help me to complete the script.
Thanks,
Ramesh