mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
service manager
This commit is contained in:
parent
a3f9c8f648
commit
fc80b0949a
19 changed files with 471 additions and 83 deletions
28
web/bulk/service/index.php
Normal file
28
web/bulk/service/index.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
// Init
|
||||
error_reporting(NULL);
|
||||
ob_start();
|
||||
session_start();
|
||||
|
||||
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
|
||||
|
||||
$service = $_POST['service'];
|
||||
$action = $_POST['action'];
|
||||
|
||||
if ($_SESSION['user'] == 'admin') {
|
||||
switch ($action) {
|
||||
case 'stop': $cmd='v-stop-service';
|
||||
break;
|
||||
case 'start': $cmd='v-start-service';
|
||||
break;
|
||||
case 'restart': $cmd='v-restart-service';
|
||||
break;
|
||||
default: header("Location: /list/services/"); exit;
|
||||
}
|
||||
foreach ($service as $value) {
|
||||
$value = escapeshellarg($value);
|
||||
exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
|
||||
}
|
||||
}
|
||||
|
||||
header("Location: /list/services/");
|
Loading…
Add table
Add a link
Reference in a new issue