From: Chris Koeritz Date: Sun, 4 Mar 2012 04:32:07 +0000 (-0500) Subject: moved sftp and ssh to security directory, which makes more sense. also extracted... X-Git-Tag: 2.140.90~1526 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=280a3b9bf411e8e81cc8ca2cbda46b544cf8899b;p=feisty_meow.git moved sftp and ssh to security directory, which makes more sense. also extracted keyfile picking to new script and made sftp use it too. --- 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 $*