This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
computing:voms_script [2017/07/11 14:51] – iwn | computing:voms_script [2020/01/31 13:55] (current) – iwn | ||
---|---|---|---|
Line 1: | Line 1: | ||
Use this code snippet in a setup script to automatically check whether the VOMS proxy needs to be prolonged: | Use this code snippet in a setup script to automatically check whether the VOMS proxy needs to be prolonged: | ||
< | < | ||
- | 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 | ||
</ | </ |