XIII
Very Senior Member
Since 1Password now offers a nice CLI that works on our router, I'm trying to make my scripts more secure, by no longer hardcoding credentials.
However I notice something weird when testing this:
Experiment 1
/jffs/scripts/test1:
/jffs/op/test.env:
/jffs/scripts/test2:
* When I manually run /jffs/scripts/test1 I see both the test1 and test2 lines in /tmp/syslog.log
* When I wait for /jffs/scripts/test1 to be executed by cron I only see test1 in the logging (not test2)
Experiment 2
Modified /jffs/scripts/test1 (not injecting credentials):
* When I manually run /jffs/scripts/test1 I see both the test1 and test2 lines in /tmp/syslog.log
* When I wait for /jffs/scripts/test1 to be executed by cron I see both the test1 and test2 lines in /tmp/syslog.log
Question
What might be limiting the 1Password CLI op tool when being executed using cron? (How can I make this work?)
However I notice something weird when testing this:
Experiment 1
/jffs/scripts/test1:
Bash:
#!/bin/sh
logger test1
/opt/bin/op run --env-file=/jffs/op/test.env -- /jffs/scripts/test2
/jffs/op/test.env:
Code:
SOME_CREDENTIAL=blabla
/jffs/scripts/test2:
Bash:
#!/bin/sh
logger test2
logger credential: $SOME_CREDENTIAL
Code:
➜ cru l
*/2 * * * * /jffs/scripts/test1 #Test#
* When I manually run /jffs/scripts/test1 I see both the test1 and test2 lines in /tmp/syslog.log
* When I wait for /jffs/scripts/test1 to be executed by cron I only see test1 in the logging (not test2)
Experiment 2
Modified /jffs/scripts/test1 (not injecting credentials):
Bash:
#!/bin/sh
logger test1
/jffs/scripts/test2
* When I manually run /jffs/scripts/test1 I see both the test1 and test2 lines in /tmp/syslog.log
* When I wait for /jffs/scripts/test1 to be executed by cron I see both the test1 and test2 lines in /tmp/syslog.log
Question
What might be limiting the 1Password CLI op tool when being executed using cron? (How can I make this work?)