moved sftp and ssh to security directory, which makes more sense. also extracted...
authorChris Koeritz <fred@gruntose.com>
Sun, 4 Mar 2012 04:32:07 +0000 (23:32 -0500)
committerChris Koeritz <fred@gruntose.com>
Sun, 4 Mar 2012 04:32:07 +0000 (23:32 -0500)
picking to new script and made sftp use it too.

scripts/security/pick_credentials.sh [new file with mode: 0755]
scripts/security/sftp.sh
scripts/security/ssh.sh

diff --git a/scripts/security/pick_credentials.sh b/scripts/security/pick_credentials.sh
new file mode 100755 (executable)
index 0000000..b8f0696
--- /dev/null
@@ -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
+
index 59cfe4c68afd8217e8adf814592ad5866af9e146..fd3817732239b0f0dd0fb87df90dd65a6153962b 100644 (file)
@@ -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" $*
index ca226c3cf21d12b913300850b3ea681758fc2ea8..48add7118461a11fd447b4cd7edfa022ab4a1bc3 100755 (executable)
@@ -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 $*