Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:08:54

0001 #!/bin/bash
0002 
0003 tokenstring=`tokens`
0004 mindelta=7200
0005 
0006 #echo "tokenstring $tokenstring"
0007 
0008 start=`expr index "$tokenstring" [`
0009 stop=`expr index "$tokenstring" ]`
0010 
0011 #echo "start $start $stop"
0012 
0013 exptime=`date --date="${tokenstring:$start+8:$stop-$start-9}" +"%s"`
0014 nowtime=`date +"%s"`
0015 delta=`expr $exptime - $nowtime`
0016 #echo "$delta"
0017 
0018 if [ $delta -le $mindelta ]; then
0019     date "+[%c] $1 . Token expires in $delta second: to be renewed"
0020 /usr/sue/bin/kinit -R
0021     tokens
0022 else
0023     date "+[%c] $1 . Token expires in $delta second: ok"
0024 fi