13 lines
545 B
PHP
13 lines
545 B
PHP
<?php
|
|
// Run on S95 via sentinel
|
|
$cmd = 'sudo -u postgres psql -d admin -tAc "SELECT COUNT(*) FROM crm.contacts WHERE company_id IS NULL"';
|
|
echo "Cmd: $cmd\n";
|
|
$ch = curl_init("https://wevads.weval-consulting.com/api/sentinel-brain.php");
|
|
curl_setopt($ch, CURLOPT_POST, true);
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(["action"=>"exec","cmd"=>$cmd]));
|
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
|
$r = curl_exec($ch);
|
|
echo "Response: $r\n";
|