diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index bbdf952f4..1a177aa93 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -182,6 +182,13 @@ mw_open() fi } +mw_unbind_domain() +{ + if [ -f $mw_path/data/bind_domain.pl ];then + rm -rf $mw_path/data/bind_domain.pl + fi +} + error_logs() { tail -n 100 $mw_path/logs/error.log @@ -271,6 +278,7 @@ case "$1" in 'update_dev') mw_update_dev;; 'install_app') mw_install_app;; 'close_admin_path') mw_close_admin_path;; + 'unbind_domain') mw_unbind_domain;; 'debug') mw_debug;; 'default') cd $mw_path diff --git a/tools.py b/tools.py index 64c33a876..64752dba4 100755 --- a/tools.py +++ b/tools.py @@ -56,6 +56,7 @@ def mwcli(mw_input=0): print("(12) 修改面板用户名") print("(13) 显示面板错误日志") print("(20) 关闭BasicAuth认证") + print("(21) 解除域名绑定") print("(0) 取消") print(raw_tip) try: @@ -65,7 +66,7 @@ def mwcli(mw_input=0): except: mw_input = 0 - nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20] + nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20, 21] if not mw_input in nums: print(raw_tip) print("已取消!") @@ -109,6 +110,11 @@ def mwcli(mw_input=0): os.remove(basic_auth) os.system(INIT_CMD + " restart") print("|-关闭basic_auth成功") + bind_domain = 'data/bind_domain.pl' + if os.path.exists(bind_domain): + os.remove(bind_domain) + os.system(INIT_CMD + " unbind_domain") + print("|-解除域名绑定成功") def set_panel_pwd(password, ncli=False):