and then any new adds...
[feisty_meow.git] / scripts / customize / fred / scripts / pick_credentials.sh
diff --git a/scripts/customize/fred/scripts/pick_credentials.sh b/scripts/customize/fred/scripts/pick_credentials.sh
new file mode 100644 (file)
index 0000000..8b4b55e
--- /dev/null
@@ -0,0 +1,17 @@
+#!/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
+
+if [ ! -f "$keyfile" ]; then
+  unset keyfile
+fi