HEX
Server: Apache/2.4.67 (Debian)
System: Linux hosting103 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User: muzikaecom (1013)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //usr/local/sbin/hp-generate-apache-vhost
#!/usr/bin/env php
<?php
require_once("/usr/local/share/hostingplatform/esrpc.php");

$client = new ESRPCConnection();
$client->connect("hp-esrpc");
$target = $client->get();

if (count($argv) <= 1) usage();

function usage() {
	global $argv;

	print $argv[0];
	print ": <packagename>\n";
	print $argv[0];
	print ": --all\n";
	exit(1);
}

if($argv[1] == "--all") {
 $packages = $target->listHostingPackages();
 foreach($packages as $package => $details) {
  print "Generating config for " . $package . "\n";
  try {
      $target->__generateApacheVHOST($package); 
        } catch (Exception $e) {
            echo $e->getTraceAsString();
        }
 }
}
else {
 $target->__generateApacheVHOST($argv[1]);
}