#!/usr/bin/bash
log_type=$(ls | grep -E 'log|lease')
exec('openssl ts -verify -data /tmp/' . $log_type . '.log -in /tmp/' . $log_type . '.l*.der -token_in -CAfile /CA/cacert.pem -untrusted /CA/tsacert.pem', $result);
getting this error when apply the above lines :
Parse error: syntax error, unexpected '=' in /usr/local/www/log_browser/dogrula.php on line 12
this is the whole lines inside dogrula.php file
<?php
$file = $_POST['file'];
$exploded = explode('.', basename($file));
$log_type = $exploded[0];
chdir('/tmp');
exec('cp /var/imzali_kayitlar/' . $file . ' ./');
exec('tar zxvf ' . basename($file));
// DoÄŸrulama komutu
log_type = $(ls | grep -E 'log|leases')
exec('openssl ts -verify -data /tmp/' . $log_type . '.log -in /tmp/' . $log_type . '.l*.der -token_in -CAfile /CA/cacert.pem -untrusted /CA/tsacert.pem', $result);
if ($result[0] == 'Verification: OK') {
$imza = file_get_contents($log_type . '.log.imza');
echo '<p class="success">Doğrulama başarılı!</p>';
echo '<div>' . nl2br($imza) . '</div>';
}
else {
echo '<p class="error">Doğrulama başarısız!</p>';
}
exec('rm ' . $log_type . '.l*');
exit;