summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscript/borg-restore.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/script/borg-restore.pl b/script/borg-restore.pl
index aa7117c..5a7d8f4 100755
--- a/script/borg-restore.pl
+++ b/script/borg-restore.pl
@@ -214,6 +214,20 @@ sub main {
Log::Log4perl::init( \$conf );
Log::Any::Adapter->set('Log4perl');
+ $SIG{__WARN__} = sub {
+ local $Log::Log4perl::caller_depth =
+ $Log::Log4perl::caller_depth + 1;
+ Log::Log4perl->get_logger()->warn(@_);
+ };
+
+ $SIG{__DIE__} = sub {
+ # ignore eval blocks
+ return if($^S);
+ local $Log::Log4perl::caller_depth =
+ $Log::Log4perl::caller_depth + 1;
+ Log::Log4perl->get_logger()->logdie(@_);
+ };
+
my %opts;
# untaint PATH because we only expect this to run as root
$ENV{PATH} = App::BorgRestore::Helper::untaint($ENV{PATH}, qr(.*));