better error message

This commit is contained in:
Isaac Connor 2016-10-04 10:29:37 -04:00
parent c1f9c0aff5
commit 21a94a6200
1 changed files with 12 additions and 6 deletions

View File

@ -28,12 +28,18 @@ $cameras = array();
$cameras[0] = translate('ChooseDetectedCamera'); $cameras[0] = translate('ChooseDetectedCamera');
function execONVIF( $cmd ) function execONVIF( $cmd ) {
{ $shell_command = escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd");
exec( escapeshellcmd(ZM_PATH_BIN . "/zmonvif-probe.pl $cmd"), $output, $status );
exec( $shell_command, $output, $status );
if ( $status )
Fatal( "Unable to probe network cameras, status is '$status'" ); if ( $status ) {
$html_output = implode( '<br/>', $output );
Fatal( "Unable to probe network cameras, status is '$status'. Output was:<br/><br/>
$html_output<br/><br/>
Please the following command from a command line for more information:<br/><br/>$shell_command"
);
}
return $output; return $output;
} }