安装和卸载

Signed-off-by: HITSword <admin@huayizhiyun.com>
master
HITSword 2020-01-17 17:20:38 +08:00
parent 796f270eba
commit 083a5d8d65
1 changed files with 56 additions and 50 deletions

106
AMHScript
View File

@ -18,58 +18,13 @@ function amh_module_info()
function amh_module_install() function amh_module_install()
{ {
if amh_module_status ; then if amh_module_status ; then
param_list=${1//,/ };
set -- $param_list;
action=$1;
domain=$2;
if [ "$action" == '' ]; then
fi;
case $1 in
list)
echo "list something"
;;
start)
echo "start something"
;;
stop)
echo "stop something"
;;
add)
echo "add something"
;;
edit)
echo "edit something"
;;
del)
echo "del something"
;;
start-cache)
echo "start cache"
;;
stop-cache)
echo "stop cache"
;;
cache)
echo "暂不支持缓存配置"
;;
cache-index)
echo "暂不支持缓存索引"
;;
cache-delete)
echo "暂不支持缓存删除"
;;
*)
echo "[Notice] AMProxy management, please select: (1~4)"
select action in 'list' 'add' 'start' 'stop' 'edit' 'del' 'start-cache' 'stop-cache' 'cache' 'cache-index' 'cache-delete'; do
break;
done;
;;
esac
exit; exit;
else else
if [ ! -f "/root/amh/modules/HYProxy-1.0/InstallComplete" ]; then
echo '[Error] HYProxy 未安装.';
exit;
fi;
touch ./InstallComplete
amh_module_status; amh_module_status;
fi; fi;
} }
@ -78,6 +33,7 @@ function amh_module_install()
function amh_module_uninstall() function amh_module_uninstall()
{ {
if amh_module_status ; then if amh_module_status ; then
rm -f /root/amh/modules/AMProxy-2.0/InstallComplete;
echo '[OK] AMProxy-2.0 Uninstall successful.'; echo '[OK] AMProxy-2.0 Uninstall successful.';
else else
exit; exit;
@ -88,6 +44,56 @@ function amh_module_uninstall()
function amh_module_admin() function amh_module_admin()
{ {
if amh_module_status ; then if amh_module_status ; then
param_list=${1//,/ };
set -- $param_list;
action=$1;
domain=$2;
if [ "$action" == '' ]; then
echo "[Notice] AMProxy management, please select: (1~4)"
select action in 'list' 'add' 'start' 'stop' 'edit' 'del' 'start-cache' 'stop-cache' 'cache' 'cache-index' 'cache-delete'; do
break;
done;
fi;
case $action in
list)
echo "list something";
;;
start)
echo "start something";
;;
stop)
echo "stop something";
;;
add)
echo "add something";
;;
edit)
echo "edit something";
;;
del)
echo "del something";
;;
start-cache)
echo "start cache";
;;
stop-cache)
echo "stop cache";
;;
cache)
echo "[Notice] 暂不支持缓存配置";
;;
cache-index)
echo "[Notice] 暂不支持缓存索引";
;;
cache-delete)
echo "[Notice] 暂不支持缓存删除";
;;
*)
echo "[Notice] 无效操作";
;;
esac
else else
exit; exit;
fi; fi;