home *** CD-ROM | disk | FTP | other *** search
- #!/usr/bin/perl
- $ver = "0.3";
- #
- # this perl script is designed for the ifmail package by eugene crosser.
- #
- # request a file (first argument) from a fido-node (second argument),
- # only 2-d addressing is supported!!! don't forget to quote if you use
- # wildcards, e.g.: ifreq 'files*' 2410/305
- # this perl script does only add an entry to the corresponding flo-file,
- # the mailer ifcico is not started!
- #
- # rasca, berlin 1994 (rasca@marie.physik.tu-berlin.de, 2:2410/305.4)
- #
-
- # change this to the default node, where requests should go to.
- $default_node = "2410/305";
-
- # this is the directory, where the req-files are stored.
- $flo_path = "/var/spool/fnet/out";
-
-
- # main()
- #
- if ((@ARGV < 1) || $ARGV[0] eq "-?") {
- &usage;
- } elsif ($ARGV[1] eq "") {
- $node = $default_node;
- } else {
- $node = $ARGV[1];
- }
-
- $file = $ARGV[0];
- $reqfile = sprintf("%04x%04x", split(/\//, $node));
-
- if ($reqfile eq "00000000") {
- print ("can't resolve the fido address \"$node\"\n");
- exit 2;
- } else {
- $reqfile = $flo_path . "/" . $reqfile . ".req";
-
- # open the flofile for appending
- open(FLOFILE, ">>" . $reqfile) || die "can't open $reqfile";
- print (FLOFILE $file, "\n");
- close(FLOFILE);
-
- print ("--- fido request $ver ---------------------------\n");
- print ("requesting \"$file\" from fido-node $node\n");
- print ("--- executing ifstat .. ------------------------\n");
- system("ifstat");
- }
-
- # subroutine "usage"
- #
- sub usage {
- printf ("--- fido request %s -------------\n", $ver);
- printf ("usage: fidoreq <file> [<2-d address>]\n");
- exit 1;
- }
-