2023-01-23 22:24:53 -07:00
|
|
|
#!/usr/bin/perl
|
|
|
|
# verify-mod-downloads - Checks a directory full of mod JAR files to make sure they've all been downloaded
|
|
|
|
# and advises you on where to go to get them if they're not present.
|
2023-01-24 01:53:08 -07:00
|
|
|
# AGRB 1/23/2023
|
2023-01-23 22:24:53 -07:00
|
|
|
|
|
|
|
die "Usage: $0 directory-name\n" if $#ARGV < 0;
|
|
|
|
my $dir = $ARGV[0];
|
|
|
|
die "$0: $dir is not a directory\n" unless -d $dir;
|
|
|
|
die "$0: $dir does not contain a modlist.txt\n" unless -f "$dir/modlist.txt";
|
|
|
|
open MODLIST, "<$dir/modlist.txt" or die "$0: unable to open $dir/modlist.txt";
|
|
|
|
my $missing = 0;
|
|
|
|
while (<MODLIST>) {
|
|
|
|
chomp;
|
2023-01-24 01:53:08 -07:00
|
|
|
next if /^\s*#/;
|
2023-01-23 22:24:53 -07:00
|
|
|
($modjar, $url) = split(/\|/);
|
|
|
|
unless (-f "$dir/$modjar") {
|
|
|
|
print "$modjar is missing - download from $url\n";
|
|
|
|
$missing++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close MODLIST;
|
|
|
|
exit ($missing > 0) ? 1 : 0;
|