--- nfo/perl/scripts/giantdisc/bin/gdc.pl 2005/03/08 20:53:46 1.2 +++ nfo/perl/scripts/giantdisc/bin/gdc.pl 2005/03/08 21:39:23 1.5 @@ -22,6 +22,7 @@ use gdclient; my $action = shift; +my $hostname = 'siggi'; sub usage { print "Usage: gdc.pl ripcd|ripstatus", "\n"; @@ -41,14 +42,18 @@ sub ripcd { - gd_connect("siggi"); + gd_connect($hostname); # 1. check if cd is already in database (probably ripped?) - if (my $check_cd = gd_command("chcd", undef, 1)) { - print "-" x 60, "\n"; - print "CD already ripped:", "\n", $check_cd, "\n"; - print "-" x 60, "\n"; + print "-" x 60, "\n"; + print "Check CD: "; + my $check_cd; + if ($check_cd = gd_command("chcd", undef, 1)) { + print "CD already ripped!"; } + print "\n"; + print $check_cd, "\n"; + print "-" x 60, "\n"; # TODO: parse $check_cd and propagate cddb-id to "lcddi", if desired @@ -85,18 +90,18 @@ } sub ripstatus { - gd_connect("siggi"); + gd_connect($hostname); while (1) { my $status_rip = gd_command("grpst", undef, 1); print "-" x 40, "\n"; print "Rip Status:", "\n"; - print $status_rip, "\n"; + print $status_rip ? $status_rip : 'No ripping process running.', "\n"; print "-" x 40, "\n"; my $status_compress = gd_command("gcpst", undef, 1); print "Compress Status:", "\n"; - print $status_compress, "\n"; + print $status_compress ? $status_compress : 'No compress process running.', "\n"; print "\n"; sleep 5;