report error without nmap output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Fri, 22 Mar 2019 18:01:14 +0000 (19:01 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 16 Nov 2021 11:45:36 +0000 (12:45 +0100)
lib/PXElator/nmap.pm

index 6759cee..984f150 100644 (file)
@@ -22,6 +22,11 @@ sub scan {
 
        system("nmap -O -oX $path $what");
 
 
        system("nmap -O -oX $path $what");
 
+       if ( ! -e $path ) {
+               warn "ERROR running nmap: $!";
+               return;
+       }
+
        my $nmap = XMLin(
                "$path",
                KeyAttr => { address => 'addrtype' },
        my $nmap = XMLin(
                "$path",
                KeyAttr => { address => 'addrtype' },