MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / bt_cli

Function bt_cli

tools.py:1114–1630  ·  view source on GitHub ↗
(u_input=0)

Source from the content-addressed store, hash-verified

1112
1113# 命令行菜单
1114def bt_cli(u_input=0):
1115 raw_tip = "==============================================="
1116 raw_tip1 = "===================================================================================="
1117 if not u_input:
1118 print("==================================宝塔面板命令行====================================")
1119 print("(1) 重启面板服务 (8) 改面板端口 |")
1120 print("(2) 停止面板服务 (9) 清除面板缓存 |")
1121 print("(3) 启动面板服务 (10) 清除登录限制 |")
1122 print("(4) 重载面板服务 (11) 设置是否开启IP + User-Agent验证 |")
1123 print("(5) 修改面板密码 (12) 取消域名绑定限制 |")
1124 print("(6) 修改面板用户名 (13) 取消IP访问限制 |")
1125 print("(7) 强制修改MySQL密码 (14) 查看面板默认信息 |")
1126 print("(22) 显示面板错误日志 (15) 清理系统垃圾 |")
1127 print("(23) 关闭BasicAuth认证 (16) 修复面板(安装当前版本的最新bug修复包) |")
1128 print("(24) 关闭动态口令认证 (17) 设置日志切割是否压缩 |")
1129 print("(25) 设置是否保存文件历史副本 (18) 设置是否自动备份面板 |")
1130 print("(26) 关闭面板ssl (19) 关闭面板登录地区限制 |")
1131 print("(28) 修改面板安全入口 (29) 取消访问设备验证 |")
1132 print("(30) 取消访问UA验证 (32) 开启/关闭【80、443】端口访问面板 |")
1133 print("(34) 更新面板(更新到最新版本) (35) btcli命令行管理工具 |")
1134 print("(36) 磁盘空间清理工具 (99) Switch to English |")
1135 print("(0) 取消 |")
1136 print(raw_tip1)
1137 try:
1138 u_input = input("请输入命令编号:")
1139 if sys.version_info[0] == 3: u_input = int(u_input)
1140 except:
1141 u_input = 0
1142 try:
1143 if u_input in ['log', 'logs', 'error', 'err', 'tail', 'debug', 'info']:
1144 os.system("tail -f {}".format(public.get_panel_log_file()))
1145 return
1146 if u_input[:6] in ['install', 'update']:
1147 print("提示:命令传参示例(编译安装php7.4):bt install/0/php/7.4")
1148 print(sys.argv)
1149 install_args = u_input.split('/')
1150 if len(install_args) < 2:
1151 try:
1152 install_input = input("请选择安装方式(0 编译安装,1 极速安装,默认: 1):")
1153 install_input = int(install_input)
1154 except:
1155 install_input = 1
1156 else:
1157 install_input = int(install_args[1])
1158 print(raw_tip)
1159 soft_list = 'nginx apache php mysql memcached redis pure-ftpd phpmyadmin pm2 docker openlitespeed mongodb'
1160 soft_list_arr = soft_list.split(' ')
1161 if len(install_args) < 3:
1162 install_soft = ''
1163 while not install_soft:
1164 print("支持的软件:{}".format(soft_list))
1165 print(raw_tip)
1166 install_soft = input("请输入要安装的软件名称(如:nginx):")
1167 if install_soft not in soft_list_arr:
1168 print("不支命令行安装的持的软件")
1169 install_soft = ''
1170 else:
1171 install_soft = install_args[2]

Callers 1

tools.pyFile · 0.70

Calls 15

openFunction · 0.85
readFileMethod · 0.80
check_ipMethod · 0.80
restart_panelMethod · 0.80
writeFileMethod · 0.80
ExecShellMethod · 0.80
get_limit_areaMethod · 0.80
get_reverse_proxyFunction · 0.70
close_reverse_proxyFunction · 0.70
create_reverse_proxyFunction · 0.70
set_reverse_proxy_sslFunction · 0.70
set_panel_pwdFunction · 0.70

Tested by

no test coverage detected