File: dlrobot.pl

package info (click to toggle)
rccp 0.5-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 164 kB
  • ctags: 40
  • sloc: ansic: 827; sh: 127; perl: 112; makefile: 66
file content (31 lines) | stat: -rwxr-xr-x 625 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl 
#downloading robot for CCCP by hampa@chello.se
#this script should not be run by itself
#usage:
#./startrobot

$home = $ENV{HOME};

opendir(DONEDIR, "$home/dc/done") or die "unable to open ~/dc/done/ directory";
@dlfiles = readdir DONEDIR;


while(<STDIN>){
	s/\n//;
	@filename  = split /\|/;
	$x = @filename[1];
	@y = split /\\/,$x;
	$remotefilename = $y[scalar(@y) - 1];
	$match = 0;
	foreach $dl (@dlfiles){
		if($remotefilename eq $dl){
			$match = 1;
		}
	}
	if(!$match){
		$nick = @filename[0];
		$remotepath = $filename[1];
		#print "match..\n";
		system "cccp -N -O -d \"*$nick**$remotepath*\""
	}
}