Skip to content

Instantly share code, notes, and snippets.

@vrillusions
Created August 18, 2014 19:34
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 vrillusions/4b1156054019437d969c to your computer and use it in GitHub Desktop.
Save vrillusions/4b1156054019437d969c to your computer and use it in GitHub Desktop.
Start multiple instances of KeePassX in OS X
#!/bin/bash
# Open a new instance of KeePassX with the specified database
#
# release: 2014-08-18
# src: https://gist.github.com/vrillusions/4b1156054019437d969c
set -e
set -u
# May be used for below filename
readonly script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# KeePassX DB
keepass_db="${script_dir}/keychain.kdb"
if [ -f "${keepass_db}" ]; then
open -n /Applications/KeePassX.app "${keepass_db}" &
else
echo "Could not locate ${keepass_db}"
echo "Press enter to continue"
read $_unused
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment