This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
computing:voms_script [2017/02/27 14:56] – created iwn | computing:voms_script [2020/01/31 13:55] (current) – iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Use this code snippet to automatically check whether the VOMS proxy needs to be prolonged: | + | Use this code snippet |
< | < | ||
- | if [[ $(voms-proxy-info --timeleft) | + | #! /bin/bash |
- | | + | function peval { echo ">>> |
- | | + | |
- | else echo ">>> | + | echo ">>> |
+ | TIMELEFT=$(voms-proxy-info --timeleft) | ||
+ | if [[ $TIMELEFT -lt 36000 ]]; then # 10 hours | ||
+ | if [[ $TIMELEFT -gt 0 ]]; then | ||
+ | echo ">>> | ||
+ | | ||
+ | echo ">>> | ||
+ | fi | ||
+ | peval "voms-proxy-init -voms cms -valid 200:0" | ||
+ | elif [[ " | ||
+ | peval "voms-proxy-init -voms cms -valid 200:0" | ||
+ | else | ||
+ | | ||
fi | fi | ||
- | <\code> | + | </code> |