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