Better error handling if dvd not found
This commit is contained in:
parent
84c522ffb5
commit
c547cf000d
17
rip_dvd.pl
17
rip_dvd.pl
@ -31,14 +31,21 @@ if($ARGV[0] eq "help" || $ARGV[0] eq "--help"){
|
||||
}
|
||||
|
||||
my $dest = "/home/julian/Videos/dvds/";
|
||||
my $title = trim `lsdvd /dev/cdrom | grep "Disc Title" | sed 's/Disc Title: //'`;
|
||||
my $title = `lsdvd /dev/cdrom | grep "Disc Title"`;
|
||||
|
||||
if(-d $dest . $title) {
|
||||
print "Destination folder already exists!";
|
||||
exit 2;
|
||||
if($? != 0){
|
||||
print "Failed reading dvd ($source). Could not get title\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
print "Ripping dvd $title ($source) to $dest";
|
||||
$title = trim `echo $title | sed 's/Disc Title: //'`;
|
||||
|
||||
print "Ripping dvd $title ($source) to $dest\n";
|
||||
|
||||
if(-d $dest . $title) {
|
||||
print "Destination folder already exists!\n";
|
||||
exit 2;
|
||||
}
|
||||
|
||||
my $exitcode = system("dvdbackup -i $source -o $dest -M -n $title");
|
||||
# $exitcode >>= 8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user