#!/usr/bin/php -q

","addLog\0
"._('Command execution')."".basename($cmd).' '.str_replace(" -","
  -",htmlspecialchars($args))."
"._('Please wait')."

","show_Wait\0$waitID"); write("addLog\0
") ; #write("addToID\0$idx\0 $action") ; $proc = popen("$command 2>&1",'r'); while ($out = fgets($proc)) { $out = preg_replace("%[\t\n\x0B\f\r]+%", '',$out); if (substr($out,0,1) == "B") { ; write("progress\0$idx\0".htmlspecialchars(substr($out,strrpos($out,"Block Pull")))) ; } else echo write("addToID\0$idx\0 ".htmlspecialchars($out)); } $retval = pclose($proc); $out = $retval ? _('The command failed').'.' : _('The command finished successfully').'!'; write("stop_Wait\0$waitID","addLog\0
$out"); return $retval===0; } #{action:"snap-", uuid:uuid , snapshotname:target , remove:remove, free:free ,removemeta:removemeta ,keep:keep, desc:desc} #VM ID [ 99]: pull. .Block Pull: [ 0 %]Block Pull: [100 %].Pull complete. $url = rawurldecode($argv[1]??''); $waitID = mt_rand(); $style = [""; foreach (explode('&', $url) as $chunk) { $param = explode("=", $chunk); if ($param) { ${urldecode($param[0])} = urldecode($param[1]) ; } } $id = 1 ; write(implode($style)."

"); $process = " " ; write("

","addLog\0
"._("Options for Block $action").":

"._('Please wait')."
"); write("addLog\0".htmlspecialchars("VMName $name ")); write("addLog\0".htmlspecialchars("SNAP $snapshotname ")); write("addLog\0".htmlspecialchars("Base $targetbase ")); if ($action == "commit") { write("addLog\0".htmlspecialchars("Top $targettop ")); write("addLog\0".htmlspecialchars("Pivot $targetpivot ")); write("addLog\0".htmlspecialchars("Delete $targetdelete ")); } switch ($action) { case "commit": vm_blockcommit($name,$snapshotname,$path,$targetbase,$targettop,$targetpivot,$targetdelete) ; break ; case "copy": vm_blockcopy($name,$snapshotname,$path,$targetbase,$targettop,$pivot,' ') ; break; case "pull": vm_blockpull($name,$snapshotname,$path,$targetbase,$targettop,$pivot,' ') ; break ; } #execCommand_nchan("ls /") ; write("stop_Wait\0$waitID") ; write('_DONE_',''); ?>