Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
cliKing
4 years agoOccasional Contributor
How to check if a session is active? (feature request)
In shell scripts I want to check that a session is active and valid and that it will still be active for the next x minutes.
The only output I need is an exit code: 0 or 1
AFAIK there is no bui...
Former Member
4 years agoI know this isn't a built-in, but I've been checking for the presence of OP_SESSION_RANDOMSTRING in the environment. grep returns non-zero when there isn't a match so something like env | grep OP_SESSION would give you the switch you're looking for until something is baked into the CLI.
Hope this helps.