Xxxxxxxxxxxxxxxxxx Script To Calculate Your Expiry Date xxxxxxxxxxxxxxxX
Most of the time we require to calculate when my password/licence will expire ... this below for what i required by all users to calculate when there password get expire ..on unix ..
You need to provide input as DD : MM : YYYY .
Now I need to convert it into Binary Like I don;t want to Give same as to my users ... I can help you with this with my below Page ..
### Convert shell script to C binary .exe (executable)
--Shirish Shukla
Most of the time we require to calculate when my password/licence will expire ... this below for what i required by all users to calculate when there password get expire ..on unix ..
You need to provide input as DD : MM : YYYY .
File: expire-date.sh
#!/bin/bash
### Calculate Expire Date
### By- Shirish Shukla
############## Hardcoded
ExpireDays=90
Hours=00;Mins=00;Secs=0;zxone=IST
##############
echo -en "Enter Password Date [ DD:MM:YYYY EG: 25:02:2012] Format \n"
echo -en "\t\t\t\t\t\t DD: " ; read dtys;
echo -en "\t\t\t\t\t\t MM: " ; read mms;
echo -en "\t\t\t\t\t\t YY: " ; read yys ;
############## Logic
EXPDT=$(date --date="$yys-$mms-$dtys $Hours:$Mins:$Secs $zxone + $ExpireDays days")
echo -en "\E[33m \n\nYOUR Password Will Expire on : " ; echo -en "\E[36m$EXPDT" | awk '{print $1 " "$3 "-" $2 "-" $NF}'
echo -en "\e[0m\n"
## How to USE
# sh expire-date.sh
Enter Password Date [ DD:MM:YYYY EG: 25:02:2012] Format
DD: 02
MM: 02
YY: 2012
YOUR Password Will Expire on : Wed 2-May-2012
Now I need to convert it into Binary Like I don;t want to Give same as to my users ... I can help you with this with my below Page ..
### Convert shell script to C binary .exe (executable)
--Shirish Shukla
No comments:
Post a Comment
Write Here .. your comments are always wellcome ..but no spam please !!