Skip to content

Instantly share code, notes, and snippets.

@lufia
Last active July 24, 2017 01:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lufia/ac0d3e987bc1a77da05194f5a82c3901 to your computer and use it in GitHub Desktop.
Save lufia/ac0d3e987bc1a77da05194f5a82c3901 to your computer and use it in GitHub Desktop.
use password from keychain into secstore
#!/usr/bin/env bash
sudo -p 'Password for %u:' bash -c "
cd $PLAN9/secstore
if [[ ! -d .git ]]
then
git init
git remote add origin git@ghe.fenrir-inc.com:$USER/secstore.git
fi
if [[ -z \$(git status -s) ]]
then
exit 0
fi
git add -A
git commit -m \"$(date +'%Y-%m-%d %H:%M:%S')\"
export GIT_SSH_COMMAND='ssh -o StrictHostKeyChecking=no -i $HOME/.ssh/id_rsa'
git push -u origin master
"
#!/usr/bin/env bash
security find-generic-password -a $USER -l secstore -w |
$PLAN9/bin/secstore -i "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment