Magellan Linux

Annotation of /alx-src/branches/alx-web-070/include/socket_send.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 10654 - (hide annotations) (download)
Wed Aug 30 14:48:15 2017 UTC (6 years, 8 months ago) by niro
File size: 547 byte(s)
-only print a message if socket send failed
1 niro 7708 <?
2 niro 8459 include("config.inc.php");
3    
4 niro 7708 function mcore_socket_send($ip, $port, $cmd)
5     {
6 niro 8460 global $mcore_certificate;
7    
8     // do not print output of system
9     ob_start();
10 niro 8459 $fingerprint = system("openssl x509 -noout -modulus -in ".$mcore_certificate." | openssl sha1 | sed 's:(stdin)=\ ::'", $retval);
11 niro 8460 ob_clean();
12 niro 8459 if ($retval == 0)
13     {
14 niro 9661 ob_start();
15     system("/usr/bin/mcore-socket-send --ip='".$ip."' --port='".$port."' --fingerprint='".$fingerprint."' --command='".$cmd."'", $sockretval);
16     ob_clean();
17 niro 10654 if ($sockretval != 0) echo "socket send failed";
18 niro 7708 }
19     }
20     ?>