parent
5a3b977f1b
commit
ac3e0ca8c9
|
|
@ -247,7 +247,6 @@ function amh_module_admin()
|
||||||
|
|
||||||
elif [ "$action" == 'del' ]; then
|
elif [ "$action" == 'del' ]; then
|
||||||
php ${module_dir}hyproxy-cli.php --action='del' --server_name=${domain}
|
php ${module_dir}hyproxy-cli.php --action='del' --server_name=${domain}
|
||||||
echo "[OK] successfully delete $domain HYProxy.";
|
|
||||||
amh nginx reload;
|
amh nginx reload;
|
||||||
elif [ "$action" == 'start' ]; then
|
elif [ "$action" == 'start' ]; then
|
||||||
php ${module_dir}hyproxy-cli.php --action='edit' --server_name=${domain} --field_name='status' --value='start';
|
php ${module_dir}hyproxy-cli.php --action='edit' --server_name=${domain} --field_name='status' --value='start';
|
||||||
|
|
@ -279,6 +278,9 @@ function amh_module_uninstall()
|
||||||
{
|
{
|
||||||
if amh_module_status ; then
|
if amh_module_status ; then
|
||||||
|
|
||||||
|
#clean proxys
|
||||||
|
php ${module_dir}hyproxy-cli.php --action='uninstall';
|
||||||
|
|
||||||
#uninstall nginx modules
|
#uninstall nginx modules
|
||||||
Cpunum=`cat /proc/cpuinfo |grep 'processor'|wc -l`;
|
Cpunum=`cat /proc/cpuinfo |grep 'processor'|wc -l`;
|
||||||
nginx_configure='--prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module --with-ipv6';
|
nginx_configure='--prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_gzip_static_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_uwsgi_module --without-http_scgi_module --with-ipv6';
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,9 @@
|
||||||
case 'del':
|
case 'del':
|
||||||
echo hyproxy_del($param['server_name']);
|
echo hyproxy_del($param['server_name']);
|
||||||
break;
|
break;
|
||||||
|
case 'uninstall':
|
||||||
|
echo hyproxy_uninstall();
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
echo 'error action';
|
echo 'error action';
|
||||||
}
|
}
|
||||||
|
|
@ -86,7 +89,7 @@
|
||||||
* @param $server_name
|
* @param $server_name
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function hyproxy_make($server_name)
|
function hyproxy_make($server_name = null)
|
||||||
{
|
{
|
||||||
global $medoo;
|
global $medoo;
|
||||||
$table = 'module_hyproxy';
|
$table = 'module_hyproxy';
|
||||||
|
|
@ -251,6 +254,19 @@
|
||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卸载插件时做的一些处理
|
||||||
|
* 谨慎使用
|
||||||
|
*/
|
||||||
|
function hyproxy_uninstall()
|
||||||
|
{
|
||||||
|
global $medoo;
|
||||||
|
$table = 'module_hyproxy';
|
||||||
|
$medoo->delete('module_hyproxy', '*');
|
||||||
|
hyproxy_make();
|
||||||
|
return "[OK] All proxy del success.\n";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除目录和子目录
|
* 删除目录和子目录
|
||||||
* @param $path
|
* @param $path
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue