fixed custom scripts issue, so now the custom folder for a user can have a "scripts...
authorChris Koeritz <fred@gruntose.com>
Mon, 26 Jan 2015 02:27:14 +0000 (21:27 -0500)
committerChris Koeritz <fred@gruntose.com>
Mon, 26 Jan 2015 02:27:14 +0000 (21:27 -0500)
customizing/fred/aliases/ssh.sh [deleted file]
customizing/fred/scripts/ssh.sh [new file with mode: 0755]
scripts/core/functions.sh
scripts/core/generate_aliases.pl

diff --git a/customizing/fred/aliases/ssh.sh b/customizing/fred/aliases/ssh.sh
deleted file mode 100755 (executable)
index 064ecf8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-
-# wraps our calling the secure shell and lets us pick our credentials.
-
-source "$FEISTY_MEOW_SCRIPTS/security/pick_credentials.sh"
-
-if [ ! -z "$keyfile" ]; then
-  \ssh -i "$keyfile" -X $*
-else
-  \ssh -X $*
-fi
-
-if [ $? -eq 0 ]; then
-  # we don't want to emit anything extra if this is being driven by git.
-  if [ -z "$(echo $* | grep git)" ]; then
-    # re-run the terminal labeller after coming back from ssh.
-    # we check the exit value because we don't want to update this for a failed connection.
-    bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
-  fi
-fi
-
-
diff --git a/customizing/fred/scripts/ssh.sh b/customizing/fred/scripts/ssh.sh
new file mode 100755 (executable)
index 0000000..2e1b374
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# wraps our calling the secure shell and lets us pick our credentials.
+
+source "$FEISTY_MEOW_SCRIPTS/security/pick_credentials.sh"
+
+if [ ! -z "$keyfile" ]; then
+  \ssh -i "$keyfile" -X -C -c blowfish-cbc $*
+else
+  \ssh -X -C -c blowfish-cbc $*
+fi
+
+if [ $? -eq 0 ]; then
+  # we don't want to emit anything extra if this is being driven by git.
+  if [ -z "$(echo $* | grep git)" ]; then
+    # re-run the terminal labeller after coming back from ssh.
+    # we check the exit value because we don't want to update this for a failed connection.
+    bash $FEISTY_MEOW_SCRIPTS/tty/label_terminal_with_infos.sh
+  fi
+fi
+
+
index 3024f8200ece981d94c4eb1fd52eaeab8400d18d..c79713379b4b2d30fce7f4d8d073acc288bc9f72 100644 (file)
@@ -339,6 +339,16 @@ if [ -z "$skip_all" ]; then
     echo "copying custom overrides for $user"
     mkdir "$FEISTY_MEOW_GENERATED/custom" 2>/dev/null
     perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom"
+    # set up any custom script files which we'll add as aliases.
+#    if [ -e "$FEISTY_MEOW_GENERATED/custom/scripts" ]; then
+#      echo removing older custom scripts.
+#      rm -rf "$FEISTY_MEOW_GENERATED/custom/scripts"
+#    fi
+    if [ -d "$FEISTY_MEOW_DIR/customizing/$user/scripts" ]; then
+      echo "copying custom scripts for $user"
+      cp -v -R "$FEISTY_MEOW_DIR/customizing/$user/scripts" "$FEISTY_MEOW_GENERATED/custom/"
+    fi
+    echo
     regenerate
   }
 
index 80f52b77ed4aca0476e0de1baf2f6dc582d76303..8408b5830cb4685bc2efb915fb0f78e6a7e662bf 100644 (file)
@@ -195,7 +195,8 @@ open(she, ">> $FEISTY_MEOW_GENERATED/fmc_aliases_for_scripts.sh");
 #@shell_files = sort(readdir(scripts));
 #print "scripts: @shell_files\n";
 
-@shell_files = &load_file_names("$FEISTY_MEOW_SCRIPTS");
+@shell_files = (&load_file_names("$FEISTY_MEOW_SCRIPTS"),
+   &load_file_names("$FEISTY_MEOW_GENERATED/custom/scripts"));
 
 # construct aliases for items in the scripts directory.
 foreach $file (@shell_files) {
@@ -218,6 +219,11 @@ foreach $file (@shell_files) {
     foreach $subfile (@subdir_files) {
       push(@shell_files, "$file/$subfile");
     }
+  } elsif (-f "$FEISTY_MEOW_GENERATED/custom/scripts/$file") {
+    # if we see a file in the auto-generated area that comes from the
+    # customized scripts folder, we add it as an alias.
+    make_alias($file, "$FEISTY_MEOW_GENERATED/custom/scripts/");
+    #print "added custom script file: $FEISTY_MEOW_GENERATED/custom/scripts/$file\n";
   } else {
     # if it's a regular file, we'll try to make an alias for it.  the function
     # will only fire if the ending is appropriate for the script languages we use.