Created
January 19, 2019 03:20
-
-
Save soywiz/b486669bb473bcc7993d896d76f97117 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export gpgconf_path=`which gpgconf` | |
echo "gpgconf_path: $gpgconf_path" | |
if [ "$gpgconf_path" = "" ]; then | |
echo Non gpg2 in path | |
exit 1 | |
fi | |
read -r -d '' homebrew_gpg_gpg_agent_plist << \ | |
_______________________________________________________________________________ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<!-- Sets a name for a task --> | |
<key>Label</key> | |
<string>homebrew.gpg.gpg-agent</string> | |
<!-- Sets a command to run and its options --> | |
<key>ProgramArguments</key> | |
<array> | |
<string>$gpgconf_path</string> | |
<string>--launch</string> | |
<string>gpg-agent</string> | |
</array> | |
<!-- Tells it to run the task once the XML is loaded --> | |
<key>RunAtLoad</key> | |
<true/> | |
</dict> | |
</plist> | |
_______________________________________________________________________________ | |
read -r -d '' link_ssh_auth_sock_plist << \ | |
_______________________________________________________________________________ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>link-ssh-auth-sock</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/bin/sh</string> | |
<string>-c</string> | |
<string>/bin/ln -sf \$HOME/.gnupg/S.gpg-agent.ssh \$SSH_AUTH_SOCK</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
</dict> | |
</plist> | |
_______________________________________________________________________________ | |
echo "$homebrew_gpg_gpg_agent_plist" > ~/Library/LaunchAgents/homebrew.gpg.gpg-agent.plist | |
launchctl load -F ~/Library/LaunchAgents/homebrew.gpg.gpg-agent.plist | |
echo "$link_ssh_auth_sock_plist" > ~/Library/LaunchAgents/link-ssh-auth-sock.plist | |
launchctl load -F ~/Library/LaunchAgents/link-ssh-auth-sock.plist |
Author
soywiz
commented
Jun 30, 2019
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment