]> git.donarmstrong.com Git - bin.git/commitdiff
update learn from ham
authorDon Armstrong <don@donarmstrong.com>
Wed, 12 Feb 2014 17:26:48 +0000 (09:26 -0800)
committerDon Armstrong <don@donarmstrong.com>
Wed, 12 Feb 2014 17:26:48 +0000 (09:26 -0800)
learn_from_spam

index 453841f7e0445ae12d6042132d35bbe9d5369fb7..b843d0519448d08f315173948f766dc9098d1f87 100755 (executable)
@@ -1,13 +1,15 @@
 #!/bin/bash
 
-if [ "$0" = "learn_from_spam" ]; then 
+if [ "$(basename $0)" = "learn_from_spam" ]; then
     for file in "$@"; do
         spamassassin -r < "$file";
         spamassassin -R < "$file";
     done;
-elif [ "$0" = "learn_from_ham" ]; then
+elif [ "$(basename $0)" = "learn_from_ham" ]; then
     for file in "$@"; do
         spamassassin -k < "$file";
         spamassassin -W < "$file";
     done;
+else
+    "Called in a way this script cannot recognize";
 fi;