From 083a5d8d654172094f7396f35e23e54a4981462c Mon Sep 17 00:00:00 2001 From: HITSword Date: Fri, 17 Jan 2020 17:20:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E8=A3=85=E5=92=8C=E5=8D=B8=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HITSword --- AMHScript | 106 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 56 insertions(+), 50 deletions(-) diff --git a/AMHScript b/AMHScript index 9e4e310..38c1e8c 100644 --- a/AMHScript +++ b/AMHScript @@ -18,58 +18,13 @@ function amh_module_info() function amh_module_install() { 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; else + if [ ! -f "/root/amh/modules/HYProxy-1.0/InstallComplete" ]; then + echo '[Error] HYProxy 未安装.'; + exit; + fi; + touch ./InstallComplete; amh_module_status; fi; } @@ -78,6 +33,7 @@ function amh_module_install() function amh_module_uninstall() { if amh_module_status ; then + rm -f /root/amh/modules/AMProxy-2.0/InstallComplete; echo '[OK] AMProxy-2.0 Uninstall successful.'; else exit; @@ -88,6 +44,56 @@ function amh_module_uninstall() function amh_module_admin() { 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 exit; fi;