cleaning updates
[feisty_meow.git] / scripts / text / new_sig.pl
1 #!/usr/bin/perl
2
3 ###############################################################################
4 #                                                                             #
5 #  Name   : new_sig                                                           #
6 #  Author : Chris Koeritz                                                     #
7 #  Rights : Copyright (C) 1996-$now by Author                                 #
8 #                                                                             #
9 #  Purpose:                                                                   #
10 #                                                                             #
11 #    Creates a new signature file using Nechung.                              #
12 #                                                                             #
13 ###############################################################################
14 #  This program is free software; you can redistribute it and/or modify it    #
15 #  under the terms of the GNU General Public License as published by the Free #
16 #  Software Foundation; either version 2 of the License or (at your option)   #
17 #  any later version.  See: "http://www.gruntose.com/Info/GNU/GPL.html" for a #
18 #  version of the License.  Please send any updates to "fred@gruntose.com".   #
19 ###############################################################################
20
21 require "filename_helper.pl";
22
23 use Env qw(HOME TMP);
24
25 # creates a new signature file for outgoing email.
26 local($temp_filename) = "$TMP/zz_signate";
27 open(FILE, ">" . $temp_filename) || die "couldn't open $temp_filename for writing.";
28
29 print FILE "_______ chosen by the Nechung Oracle Program [ http://gruntose.com/ ] _______\n";
30 print FILE "\n";
31 close(FILE);
32 local($bindir) = $ENV{'FEISTY_MEOW_BINARIES'};
33 $bindir = &sanitize_name($bindir);
34 $app_path = "$bindir/nechung";
35 if (-e $app_path) {
36   system("$app_path >>$temp_filename");
37   open(FILE, ">>" . $temp_filename) || die "couldn't open $temp_filename for writing.";
38 } else {
39   open(FILE, ">>" . $temp_filename) || die "couldn't open $temp_filename for writing.";
40   print FILE "nechung oracle program (NOP) could not be found.\n";
41 }
42 print FILE "\n";
43 print FILE "_____________ not necessarily my opinions, not necessarily not. _____________\n";
44 close(FILE);
45
46 open(FILE, "<" . $temp_filename) || die "couldn't open $temp_filename for reading.";
47 foreach $line (<FILE>) { print $line; }
48 close(FILE);
49