From 280a3b9bf411e8e81cc8ca2cbda46b544cf8899b Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 3 Mar 2012 23:32:07 -0500 Subject: [PATCH] moved sftp and ssh to security directory, which makes more sense. also extracted keyfile picking to new script and made sftp use it too. --- scripts/security/pick_credentials.sh | 14 ++++++++++++++ scripts/security/sftp.sh | 2 +- scripts/security/ssh.sh | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100755 scripts/security/pick_credentials.sh diff --git a/scripts/security/pick_credentials.sh b/scripts/security/pick_credentials.sh new file mode 100755 index 00000000..b8f0696f --- /dev/null +++ b/scripts/security/pick_credentials.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# chooses the right certificate to use for logging in via ssh. + +#hmmm: not the slightest bit general here currently. +# what about having a main key variable and a sourceforge key variable? +# better yet, an array of site patterns and keys for those sites. + +keyfile="$HOME/.ssh/id_dsa_fred" + +if [ ! -z "$(echo $* | grep -i sourceforge)" ]; then + keyfile="$HOME/.ssh/id_dsa_sourceforge" +fi + diff --git a/scripts/security/sftp.sh b/scripts/security/sftp.sh index 59cfe4c6..fd381773 100644 --- a/scripts/security/sftp.sh +++ b/scripts/security/sftp.sh @@ -1,6 +1,6 @@ #!/bin/bash -source "$FEISTY_MEOW_SCRIPTS/pick_credentials.sh" +source "$FEISTY_MEOW_SCRIPTS/security/pick_credentials.sh" # a wrapper for the file transfers using secure shell. \sftp -i "$keyfile" $* diff --git a/scripts/security/ssh.sh b/scripts/security/ssh.sh index ca226c3c..48add711 100755 --- a/scripts/security/ssh.sh +++ b/scripts/security/ssh.sh @@ -2,7 +2,7 @@ # wraps our calling the secure shell and lets us pick our credentials. -source "$FEISTY_MEOW_SCRIPTS/pick_credentials.sh" +source "$FEISTY_MEOW_SCRIPTS/security/pick_credentials.sh" \ssh -i "$keyfile" -X $* -- 2.34.1