Skip to content
Permalink
Browse files

Add helper script file

  • Loading branch information...
Raggaer committed Jun 3, 2019
1 parent 7ac937d commit 2e0deac4e7894ab0b8e670ccb6858b019af9e9e2
Showing with 25 additions and 0 deletions.
  1. +25 −0 opcli_helper.sh
@@ -0,0 +1,25 @@
#!/bin/bash

# Function to retrieve 1Password items using opcli
function pwget {
if [ -n "$1" ]; then
if [ -z "${OP_SESSION_my}" ]; then
eval $(op signin)
fi
opcli -c "get" -s "item" -i "$1" --pw
else
echo "Provide an item to retrieve the password!"
fi
}

# Function to search for 1Password items
function pwsearch {
if [ -n "$1" ]; then
if [ -z "${OP_SESSION_my}" ]; then
eval $(op signin)
fi
opcli -c "list" -s "items" --search "$1"
else
echo "Provide a name to search for!"
fi
}

0 comments on commit 2e0deac

Please sign in to comment.
You can’t perform that action at this time.