summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kaufmann <astra@ionic.at>2018-03-20 14:37:55 +0100
committerDavid Kaufmann <astra@ionic.at>2018-03-20 14:37:55 +0100
commit89ab7280470bfc625a8edad2a2d5ddb74bf82cb6 (patch)
treec26f86b0f8c985644f0634f6e58a88acab6a5496
parentcf370b012f73989b34798f2199efd6dd18252640 (diff)
downloadconfig-89ab7280470bfc625a8edad2a2d5ddb74bf82cb6.tar.gz
auto-add ssh-keys on remote hosts
-rw-r--r--home/.zprofile14
1 files changed, 9 insertions, 5 deletions
diff --git a/home/.zprofile b/home/.zprofile
index 295cde5..6ed6978 100644
--- a/home/.zprofile
+++ b/home/.zprofile
@@ -1,3 +1,5 @@
+main_node() { [[ "$HOSTNAME" == "anduin" ]] }
+
export XDG_CURRENT_DESKTOP=kde
export LANG='en_US.UTF-8'
@@ -22,11 +24,13 @@ function start_agent {
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
- if [[ -x /usr/bin/ssh-add ]]; then
- if [[ -d ${HOME}/.ssh/keys ]]; then
- for key in $(find ${HOME}/.ssh/keys/ -maxdepth 1 -name 'id_*' | egrep -v '.pub$'); do
- /usr/bin/ssh-add $key
- done
+ if ! main_node; then
+ if [[ -x /usr/bin/ssh-add ]]; then
+ if [[ -d ${HOME}/.ssh/keys ]]; then
+ for key in $(find ${HOME}/.ssh/keys/ -maxdepth 1 -name 'id_*' | egrep -v '.pub$'); do
+ /usr/bin/ssh-add $key
+ done
+ fi
fi
fi
}