加入切换linux软件源的命令

pull/350/head
midoks 2 years ago
parent c49bc6f823
commit 7cf64673f9
  1. 11
      scripts/init.d/mw.tpl
  2. 33
      tools.py

@ -215,6 +215,17 @@ mw_update_dev()
cd /www/server/mdserver-web cd /www/server/mdserver-web
} }
mw_mirror()
{
cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"")
if [ ! -z "$cn" ];then
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
else
bash <(curl -sSL https://raw.githubusercontent.com/midoks/change-linux-mirrors/main/change-mirrors.sh)
fi
cd /www/server/mdserver-web
}
mw_install_app() mw_install_app()
{ {
bash $mw_path/scripts/quick/app.sh bash $mw_path/scripts/quick/app.sh

@ -47,20 +47,21 @@ def mwcli(mw_input=0):
raw_tip = "======================================================" raw_tip = "======================================================"
if not mw_input: if not mw_input:
print("===============mdserver-web cli tools=================") print("===============mdserver-web cli tools=================")
print("(1) 重启面板服务") print("(1) 重启面板服务")
print("(2) 停止面板服务") print("(2) 停止面板服务")
print("(3) 启动面板服务") print("(3) 启动面板服务")
print("(4) 重载面板服务") print("(4) 重载面板服务")
print("(5) 修改面板端口") print("(5) 修改面板端口")
print("(10) 查看面板默认信息") print("(10) 查看面板默认信息")
print("(11) 修改面板密码") print("(11) 修改面板密码")
print("(12) 修改面板用户名") print("(12) 修改面板用户名")
print("(13) 显示面板错误日志") print("(13) 显示面板错误日志")
print("(20) 关闭BasicAuth认证") print("(20) 关闭BasicAuth认证")
print("(21) 解除域名绑定") print("(21) 解除域名绑定")
print("(100) 开启PHP52显示") print("(100) 开启PHP52显示")
print("(101) 关闭PHP52显示") print("(101) 关闭PHP52显示")
print("(0) 取消") print("(200) 切换Linux系统软件源")
print("(0) 取消")
print(raw_tip) print(raw_tip)
try: try:
mw_input = input("请输入命令编号:") mw_input = input("请输入命令编号:")
@ -69,7 +70,7 @@ def mwcli(mw_input=0):
except: except:
mw_input = 0 mw_input = 0
nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20, 21, 100, 101] nums = [1, 2, 3, 4, 5, 10, 11, 12, 13, 20, 21, 100, 101, 200]
if not mw_input in nums: if not mw_input in nums:
print(raw_tip) print(raw_tip)
print("已取消!") print("已取消!")
@ -135,6 +136,8 @@ def mwcli(mw_input=0):
cont = re.sub("\"5.2.17\",", cont) cont = re.sub("\"5.2.17\",", cont)
mw.writeFile(php_conf, cont) mw.writeFile(php_conf, cont)
print("|-执行PHP52隐藏成功!") print("|-执行PHP52隐藏成功!")
elif mw_input == 200:
os.system(INIT_CMD + " mirror")
def set_panel_pwd(password, ncli=False): def set_panel_pwd(password, ncli=False):

Loading…
Cancel
Save