From 34b83149dfcfc0604809984339fc717a7cc58368 Mon Sep 17 00:00:00 2001 From: Simonas Narbutas Date: Wed, 11 Jul 2018 10:37:39 +0200 Subject: [PATCH] changes ssh wrap --- .gitmodules | 2 +- .zsh-git-prompt | 1 - .zsh.d/20-functions.zsh | 16 ++++++++++++++++ .zsh.d/20-ssh.zsh | 13 ------------- 4 files changed, 17 insertions(+), 15 deletions(-) delete mode 160000 .zsh-git-prompt create mode 100644 .zsh.d/20-functions.zsh delete mode 100644 .zsh.d/20-ssh.zsh diff --git a/.gitmodules b/.gitmodules index 392bf5b..76bab74 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule ".zsh-git-prompt"] path = .zsh-git-prompt - url = http://localhost:8081/simas/dotfiles.git + url = https://github.com/olivierverdier/zsh-git-prompt.git diff --git a/.zsh-git-prompt b/.zsh-git-prompt deleted file mode 160000 index 0a6c8b6..0000000 --- a/.zsh-git-prompt +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0a6c8b610e799040b612db8888945f502a2ddd9d diff --git a/.zsh.d/20-functions.zsh b/.zsh.d/20-functions.zsh new file mode 100644 index 0000000..92fd521 --- /dev/null +++ b/.zsh.d/20-functions.zsh @@ -0,0 +1,16 @@ +OS_TYPE=$(uname -s) +if [ "$OS_TYPE" = "Darwin" ]; then + PWDID=6731738634759616518 + BID=snarbutas@BOLCOM.NET + function ssh() { + if ! kswitch -p "$BID"; then + lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" + elif klist -l | grep "*"|grep Expired; then + lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" + fi + eval TERM=screen `/usr/bin/which ssh` $* + } +fi +decrypt () { + ssh -qtt shd-puppet-server-001.bolcom.net "sudo /opt/puppetlabs/bin/puppetserver ruby /var/lib/puppetserver/jruby-gems/gems/hiera-eyaml-2.1.0/bin/eyaml decrypt -s "${1}" 2>/dev/null" +} diff --git a/.zsh.d/20-ssh.zsh b/.zsh.d/20-ssh.zsh deleted file mode 100644 index 7f8412c..0000000 --- a/.zsh.d/20-ssh.zsh +++ /dev/null @@ -1,13 +0,0 @@ -PWDID=6731738634759616518 -BID=snarbutas@BOLCOM.NET -function ssh() { - if ! kswitch -p "$BID"; then - lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" - elif klist -l | grep "*"|grep Expired; then - lpass show --password "$PWDID" | kinit --password-file=STDIN "$BID" - fi - eval TERM=screen `/usr/bin/which ssh` $* -} -decrypt () { - ssh -qtt shd-puppet-server-001.bolcom.net "sudo /opt/puppetlabs/bin/puppetserver ruby /var/lib/puppetserver/jruby-gems/gems/hiera-eyaml-2.1.0/bin/eyaml decrypt -s "${1}" 2>/dev/null" -}