#!/usr/bin/php conf=$conf; # Here we go switch ($argv[1]) { case "start": if (empty($argv[2]) || empty($argv[3]) || empty($argv[4])) { help(); die(); } $r = $lxc->start_vm($argv[2], $argv[3], $argv[4]); echo serialize($r); break; case "stopall": $r=$lxc->stopall_vm(); echo serialize($r); break; case "stop": if (empty($argv[2])) { help(); die(); } $r=$lxc->stop_vm($argv[2]); echo serialize($r); break; case "unlock": $r=$lxc->unlock(); echo serialize($r); break; case "lock": $r=$lxc->lock(); echo serialize($r); break; case "monit": $r=$lxc->monit(); echo serialize($r); break; case "list": $r=$lxc->listvm(); echo "$r"; break; default: help(); die(); } ?>