[go: up one dir, main page]

Menu

[r80]: / action.php  Maximize  Restore  History

Download this file

35 lines (30 with data), 633 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
include_once 'functions.php';
$service=new MLService($_GET['service']);
if($service->getID()==null) {
echo "failed";
die();
}
$machine=new MLMachine($service->getMachineID());
//$host=$machine->getHost();
//$user=$machine->get;
//$pass=$machine['password'];
//$port=$machine['ssh_port'];
$srv_name=$service->getServiceName();
$cmd="/etc/init.d/$srv_name ";
switch($_GET['action']){
case "start":
$cmd.=" start";
break;
case "stop":
$cmd.=" stop";
break;
case "restart":
$cmd.=" restart";
break;
default:
die();
}
$out=$machine->executeCommand($cmd);
echo "success";
?>