parent
9b0843f21b
commit
221452ffca
|
|
@ -85,7 +85,8 @@ function amh_module_admin()
|
|||
fi;
|
||||
;;
|
||||
del)
|
||||
echo "del something";
|
||||
php ${module_dir}cli.php --action='del' --server_name=${domain}
|
||||
amh nginx reload;
|
||||
;;
|
||||
start-cache)
|
||||
echo "start cache";
|
||||
|
|
|
|||
36
cli.php
36
cli.php
|
|
@ -85,6 +85,7 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* 【完成】
|
||||
* 新建反向代理
|
||||
* @param $server_name
|
||||
* @param string $proxy_pass
|
||||
|
|
@ -137,7 +138,7 @@
|
|||
* @param string $value
|
||||
* @return string
|
||||
*/
|
||||
function hyproxy_edit($server_name, $field_name = '', $value = '')
|
||||
function amproxy_edit($server_name, $field_name = '', $value = '')
|
||||
{
|
||||
if (empty($server_name)) {
|
||||
return "[Error] The server_name is empty.\n";//不能为空
|
||||
|
|
@ -178,4 +179,37 @@
|
|||
}
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除反向代理
|
||||
* @param $server_name
|
||||
* @return string
|
||||
*/
|
||||
function hyproxy_del($server_name = null)
|
||||
{
|
||||
$res = '';
|
||||
if (empty($server_name)) {
|
||||
$res = "[Error] The server_name is empty.\n";//不能为空
|
||||
} else {
|
||||
global $medoo;
|
||||
$table = 'module_hyproxy';
|
||||
$columns = '*';
|
||||
$where = array('server_name'=>trim($server_name));
|
||||
$row = $medoo->get($table, $columns, $where);
|
||||
if (empty($row)) {
|
||||
$res = "[Error] $server_name AMProxy not exist!\n";//不存在
|
||||
} else {
|
||||
$mysqlres = $medoo->delete($table, $where);
|
||||
if ($mysqlres) {
|
||||
$res = "[OK] successfully delete $server_name AMProxy.\n";
|
||||
} else {
|
||||
$res = "[Error] error delete $server_name AMProxy.\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
unlink(_HYCONF . $server_name . '.conf');//删除配置文件
|
||||
unlink(_HYLOGS . $server_name . '.access.log');//删除日志文件
|
||||
unlink(_HYLOGS . $server_name . '.error.log');//删除日志文件
|
||||
return $res;
|
||||
}
|
||||
Loading…
Reference in New Issue