diff options
author | J Pipkin <j@dawnrazor.net> | 2013-01-12 04:14:03 -0600 |
---|---|---|
committer | J Pipkin <j@dawnrazor.net> | 2013-01-12 04:14:03 -0600 |
commit | be2bb2b27d61a39bff6efd890c3d519c39db321e (patch) | |
tree | 387f0c14a12526c6eb1668b3d588ded1a0472212 /sbocheck | |
parent | b2a26f795d32e398bfc3dbfc13882419bd3ba929 (diff) | |
download | sbotools-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-x | sbocheck | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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."; } |