Protect what matters – even after you're gone. Make a plan for your digital legacy today.
Forum Discussion
mickael
4 years agoDedicated Contributor
Keeping op cli auth
Hi,
Can we still maintain an op cli session opened ?
In previous versions this was possible by quering the server with
op account get --account="XXXXX"
It looks like this is no more the...
mickael
4 years agoDedicated Contributor
It looks like I am unable to auth in scripts even if OP_ variables are defined.
Here is the script I was using:
```
!/bin/bash
source /etc/profile
. "${HOME}/.bin.base/opsign.sh"
eval $(get1PasswordSession)
env|grep OP_
op account get --account="BUSINESS_UUID" > /dev/null
MY="$?"
op account get --account="PROJECT_UUID" > /dev/null
TEAM="$?"
echo "$(($MY+$TEAM))"
```
The result given is:
OP_SESSION_hash1=key1
OP_SESSION_hash2=key2
2
If I run the commands in a terminal it works correctly, I double checked the OP_SESSION env vars and they are the same.
Any clue why op can't authenticate properly in script ?