Skip to content

Instantly share code, notes, and snippets.

@viktorbenei
Created November 23, 2015 17:50
Show Gist options
  • Save viktorbenei/c63ac51d8564bf595bf6 to your computer and use it in GitHub Desktop.
Save viktorbenei/c63ac51d8564bf595bf6 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# Unlock the keychain, using the Bitrise.io Keychain password environment
#
keychain_path="$HOME/Library/Keychains/login.keychain"
keychain_password="$BITRISE_KEYCHAIN_PASSWORD"
set -e
set -x
security -v set-keychain-settings -lut 72000 "${keychain_path}"
security -v list-keychains -s $(security -v list-keychains | tr -d '"') "${keychain_path}"
security -v default-keychain -s "${keychain_path}"
security -v unlock-keychain -p "${keychain_password}" "${keychain_path}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment