# my @email;
$c->{'email_only_on_alert'} ||= 0;
my $help = 0;
-$c->{'xml_file'} ||= undef;
my $verbose = 0;
$c->{'disk_space_warn'} ||= 95; # Percent to warn at.
$c->{'guide_days_warn'} ||= 2; # How many days we require.
-$c->{'auto_expire_count'} ||= 10; # How many auto expire shows to display.
+$c->{'auto_expire_count'} ||= 10; # How many auto expire shows to display.
$c->{'recording_in_warn'} ||= 60 * 60; # When is the next recording considered critical? (seconds)
+$c->{'save_file'} ||= undef; # File to save the XML from the BE to.
+$c->{'xml_file'} ||= undef; # Load the BE XML from this file.
# We allow a hack for MS Outlook which normally recognises the
# oneliners block as a paragraph and wraps it. If it sees "bullets"
my $return_code_only = 0;
-my $VERSION = '0.10.1';
+my $VERSION = '0.10.2';
# Some display blocks are disabled by default:
$c->{'display'}{'Shows due to Auto Expire'} = 0;
'return-code-only' => \$return_code_only,
'file=s' => \$c->{'xml_file'},
+ 's|save-file=s' => \$c->{'save_file'},
'verbose' => \$verbose,
'help|?' => \$help,
($charset) = ($content_type =~ /charset="(\S+?)"/);
}
+ if (defined $c->{'save_file'}) {
+ open(OUT, "> $c->{'save_file'}")
+ || die "Failed to open " . $c->{'save_file'} . " for writing: $!\n";
+ print OUT $status;
+ close OUT;
+ }
+
# Parse the XML
my $parser = XML::LibXML->new();
clean_xml(\$status);
- # Try and hide any error messages thar XML::LibXML insists on printing out.
+ # Try and hide any error messages that XML::LibXML insists on printing out.
open my $olderr, ">&STDERR";
open(STDERR, "> /dev/null") || die "Can't redirect stderr to /dev/null: $!";
Load XML from the file specified instead of querying a MythTV backend.
Handy for debugging things.
+=item B<< --save-file <file> >>
+
+Save the XML we received from the MythTV backend.
+Handy for debugging things.
+
=item B<< --guide-days-warn <days> >>
Warn if the number of days of guide data present is equal to or below