single_command.php 405 B

12345678910111213141516
  1. #!/usr/bin/php
  2. <?php
  3. require_once('ESL.php');
  4. if ($argc > 1) {
  5. array_shift($argv);
  6. $command = sprintf('%s', implode(' ', $argv));
  7. printf("Command to run is: %s\n", $command);
  8. $esl = new eslConnection('127.0.0.1', '8021', 'ClueCon');
  9. $e = $esl->api("$command");
  10. print $e->getBody();
  11. } else {
  12. printf("ERROR: You Need To Pass A Command\nUsage:\n\t%s <command>", $argv[0]);
  13. }
  14. ?>