[BACK]Return to NewTorrents.pl CVS log [TXT][DIR] Up to [local] / openbsd / OpenBSDTorrents

Diff for /openbsd/OpenBSDTorrents/NewTorrents.pl between version 1.2 and 1.3

version 1.2, 2005/03/24 05:32:49 version 1.3, 2005/03/25 03:13:45
Line 7 
Line 7 
 use lib 'lib';  use lib 'lib';
 use OpenBSDTorrents;  use OpenBSDTorrents;
   
   use POSIX 'setsid';
   
 %ENV = ();  %ENV = ();
   
 use YAML;  use YAML;
   
   # *** This requires --log-format="%t [%p] %o %f %l" on the rsync command
   
 my $last_dir = '';  my $last_dir = '';
 while (<>) {  while (<>) {
         chomp;          chomp;
Line 29 
Line 33 
 }  }
 StartTorrent($last_dir);  StartTorrent($last_dir);
   
   sleep(90);
   
   StartTorrent('skip');
   
   
 sub StartTorrent  sub StartTorrent
 {  {
         my $dir = shift;          my $dir = shift;
           return undef unless $dir;
   
           if ($dir ne 'skip') {
                   $dir = "$BaseName/$dir";
           }
   
         # This actually needs to be a sub that forks off          # This actually needs to be a sub that forks off
         # the generation of this, and the running of the update script.          # the generation of this, and the running of the update script.
         print "MakeTorrents.pl $BaseName/$dir\n";          print "MakeTorrents.pl $BaseName/$dir\n";
   
           defined(my $pid = fork) or die "Can't fork: $!";
   
           return if $pid;
   
           chdir $HomeDir          or die "Can't chdir to $HomeDir: $!";
   
           setsid                  or die "Can't start a new session: $!";
           #open STDIN, '/dev/null' or die "Can't read /dev/null: $!";
           #open STDOUT, '>/dev/null'
           #                        or die "Can't write /dev/null: $!";
           #open STDERR, '>&STDOUT'        or die "Can't dup stdout: $!";
   
           exec('/home/andrew/OpenBSDTorrents/regen.sh', "$dir");
 }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>