SLRN random-sig files, found this but stilll
looking to set up random sig with SLRN I found this link:
http://lists.infodrom.org/debian-user-de/2001/03/att-0026/01-slrn-random-sig
At the end it says one need to create for each quote a single file, my
question is:
what name can I use and or does this scrip just take any files it finds
and uses them as signatures?
Thanks
*** start of quoted material***
>From MarcLanger@gmx.de Wed Apr 26 00:44:33 2000
From: MarcLanger@gmx.de (Marc Langer)
Subject: Re: Wechselnde Signaturen =?iso-8859-1?Q?f=FCr?= slrn
Date: 21 Apr 2000 20:30:38 GMT
Lines: 141
Message-ID: <8dqdpe$9d9$1@marclanger.de>
References: <a8sed8.802.ln@Johannes.Segitz.dialin.t-online.de>
NNTP-Posting-Host: marclanger.de
NNTP-Posting-Date: 21 Apr 2000 20:30:38 GMT
User-Agent: slrn/0.9.6.2-ml (Linux)
Xref: kalwien.regio.rhein-ruhr.de de.comm.software.newsreader:10648
Am Mon, 17 Apr 2000 13:23:54 +0200 schrieb Johannes Segitz:
>ich habe gehört, dass es für slrn Makros gibt, um die Signatur
>durchzuwechseln. Wo kann ich so etwas zu bekommen, und welche
>sind empfehlenswert?
Hier ist eines:
------- slrn.sl -----------------------------------------------------
define article_mode_hook ()
{
variable signature_file = ".randsignature";
variable newsgroup = current_newsgroup ();
set_string_variable ("signature", signature_file);
};
define startup_hook () {
system("sigrandom.pl"); }
------------------------------------------------------------------
In der .slrnrc: "interpret slrn.sl".
Das Perlscript (stammt von Stefan Scholl):
----------- sigrandom.pl -----------------------------------------
#! /usr/bin/perl -w
# $Id: sigrandom.pl,v 1.4 1997/08/10 20:11:14 stesch Exp stesch $
chdir; # go home
$FIFO = $ENV{'HOME'} . '/.randsignature';
$fixed = $ENV{'HOME'} . '/.sigfixed';
$sigdir = $ENV{'HOME'} . '/.Sig';
# $lockfile = '/var/lock/sigrandom.lock';
$lockfile = $ENV{'HOME'} . '/.sigrandom.lock';
# --------
sub catch_zap {
my $signame = shift;
unlink($lockfile);
die "Got SIG$signame";
}
# --------
$SIG{INT} = \&catch_zap;
$SIG{TERM} = \&catch_zap;
$SIG{QUIT} = \&catch_zap;
$SIG{HUP} = \&catch_zap;
exit if(-e $lockfile);
unless (-p $FIFO) {
unlink $FIFO;
system('mknod', $FIFO, 'p') && die "can't mknod $FIFO: $!";
}
# --- fork
my $pid;
FORK: {
if($pid = fork) {
print "sigrandom.pl forked\n";
sleep 1;
exit;
} elsif (defined $pid) {
# forked process
} elsif ($! =~ /No more process/) { # == EAGAIN
sleep 5;
redo FORK;
} else {
die "***Can't fork: $!\n";
}
}
# ---
open(L, ">$lockfile") || die "can't open $lockfile: $!";
print L $$;
close(L);
srand ($$ ^ time);
while (1) {
unless (-p $FIFO) {
unlink $FIFO;
system('mknod', $FIFO, 'p') && die "can't mknod $FIFO: $!";
}
# next line blocks until there's a reader
open (FIFO, "> $FIFO") || die "can't write $FIFO: $!";
# print FIFO "-- \n";
if(open(FIX, $fixed)) {
while(<FIX>) {
print FIFO $_;
}
close(FIX);
}
if(opendir(DIR, $sigdir)) {
@randfiles = grep( !/^\./, readdir(DIR));
if(open(RAND, $sigdir . '/' . $randfiles[rand($#randfiles)])) {
while(<RAND>) {
print FIFO $_;
}
close(RAND);
}
closedir(DIR);
}
close FIFO;
sleep 2; # to avoid dup sigs
}
exit;
------------------------------------------------------------------
Nun musst Du noch in ~/.Sig/ die Signaturen anlegen: Jede in
eine Datei, ein fester Bestandteil kann in ~/.sigfixed geschrieben
werden.
Damit müsste das dann eigentlich funktionieren.
Marc
--
LinuxUser aka Josef Oswald linux.os@chello.at
--
registered-linux-user # 134.818 at http://counter.li.org
The box said Windows, NT or better, so I installed Linux :-)
Reply to: