aboutsummaryrefslogtreecommitdiff
path: root/sbocheck
diff options
context:
space:
mode:
authorJ Pipkin <j@dawnrazor.net>2013-01-12 04:14:03 -0600
committerJ Pipkin <j@dawnrazor.net>2013-01-12 04:14:03 -0600
commitbe2bb2b27d61a39bff6efd890c3d519c39db321e (patch)
tree387f0c14a12526c6eb1668b3d588ded1a0472212 /sbocheck
parentb2a26f795d32e398bfc3dbfc13882419bd3ba929 (diff)
downloadsbotools-be2bb2b27d61a39bff6efd890c3d519c39db321e.tar.xz
implement failure-dependent exit statuses, ask to proceed if a failure is encountered during the process
Diffstat (limited to 'sbocheck')
-rwxr-xr-xsbocheck13
1 files changed, 9 insertions, 4 deletions
diff --git a/sbocheck b/sbocheck
index 5b36f57..2279717 100755
--- a/sbocheck
+++ b/sbocheck
@@ -85,10 +85,15 @@ sub print_output($) {
# save a log of available updates
my $logfile = '/var/log/sbocheck.log';
unlink $logfile if -f $logfile;
- my $log_fh = open_fh($logfile, '>');
- say {$log_fh} $_ for @$listing;
- close $log_fh;
- say "A copy of the above result is kept in $logfile\n";
+ my ($log_fh, $exit) = open_fh($logfile, '>');
+ # non-fatal
+ if ($exit) {
+ warn $log_fh if $exit;
+ } else {
+ say {$log_fh} $_ for @$listing;
+ close $log_fh;
+ say "A copy of the above result is kept in $logfile\n";
+ }
} else {
say "\nNo updates available.";
}