updated to support 6 digits instead of 4.
[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 require "importenv.pl";
23
24 # creates a new signature file for outgoing email.
25 local($temp_filename) = "$TMP/zz_signate";
26 open(FILE, ">" . $temp_filename) || die "couldn't open $temp_filename for writing.";
27
28 print FILE "_______ chosen by the Nechung Oracle Program [ http://gruntose.com/ ] _______\n";
29 print FILE "\n";
30 close(FILE);
31 local($bindir) = $ENV{'BINDIR'};
32 $bindir = &sanitize_name($bindir);
33 system("$bindir/nechung >>$temp_filename");
34 ###always hits this.  nechung gives an error? || die "couldn't run nechung.";
35 open(FILE, ">>" . $temp_filename) || die "couldn't open $temp_filename for writing.";
36 print FILE "\n";
37 print FILE "_____________ not necessarily my opinions, not necessarily not. _____________\n";
38 close(FILE);
39
40 open(FILE, "<" . $temp_filename) || die "couldn't open $temp_filename for reading.";
41 foreach $line (<FILE>) { print $line; }
42 close(FILE);
43