提交 6a58107a authored 作者: 陈泽健's avatar 陈泽健

feat(scripts): 增强脚本交互性与配置检查能力

- 移除 EMQX 配置文件冗余路径检查
- 新增 issue_handler.sh 交互式菜单模式
- 支持本地运行时通过菜单选择执行动作
- 实现 NTP、端口、IP、权限等常见问题处理入口
- 增加非交互模式和确认选项支持
- 注释掉讯飞系统巡检中的转录文字检测逻辑
上级 4247dbb8
......@@ -2009,6 +2009,72 @@ run_action_by_name() {
esac
}
# 交互式模式(本地运行时的菜单)
interactive_mode() {
local action=""
local platform="auto"
echo "请选择平台 [auto/new/standard] (默认: auto):"
read -r input; [ -n "$input" ] && platform="$input"
echo "请选择要执行的动作:"
cat <<'MENU'
1) fix_ntp_config 修复 NTP/Chrony
2) fix_port_access 修复端口开放
3) fix_ip_configurations 批量替换配置中的IP
4) fix_permissions 修复文件权限
5) fix_db_permissions 修复数据库权限
6) fix_dns_config 修复DNS配置
7) export_and_compress_logs 导出并压缩日志
8) rotate_logs 轮转日志
9) backup_environment_data 打包备份环境
c) clean_deleted_files 清理已删除未释放文件
q) 退出
MENU
read -r sel
case "$sel" in
1) action="fix_ntp_config" ;;
2) action="fix_port_access" ;;
3) action="fix_ip_configurations" ;;
4) action="fix_permissions" ;;
5) action="fix_db_permissions" ;;
6) action="fix_dns_config" ;;
7) action="export_and_compress_logs" ;;
8) action="rotate_logs" ;;
9) action="backup_environment_data" ;;
c|C) action="clean_deleted_files" ;;
q|Q) log_info "已退出"; return 0 ;;
*) log_error "无效选择"; return 1 ;;
esac
echo -n "是否启用非交互模式并默认同意操作? [y/N]: "
read -r yn
if [[ "$yn" =~ ^[yY]$ ]]; then
NON_INTERACTIVE=1
ASSUME_YES=1
fi
# 为需要额外参数的动作采集输入
if [ "$action" = "fix_ip_configurations" ]; then
if [ -z "$ARG_OLD_IP" ]; then
echo -n "请输入需要替换的旧IP: "
read -r ARG_OLD_IP
fi
if [ -z "$ARG_NEW_IP" ]; then
echo -n "请输入新的IP: "
read -r ARG_NEW_IP
fi
elif [ "$action" = "fix_db_permissions" ]; then
if [ -z "$ARG_DB_ROOT_PASS" ]; then
echo -n "请输入数据库root密码(回显隐藏): "
stty -echo; read -r ARG_DB_ROOT_PASS; stty echo; echo
fi
fi
log_info "即将执行: $action (平台: $platform)"
run_action_by_name "$action" "$platform"
}
# ...existing code...
main() {
local ACTION=""
......
......@@ -2402,7 +2402,6 @@ function Check-FilePermissions {
"/var/www/paperless/run.sh",
"/var/www/paperless/start.sh",
"/var/www/redis/redis-*.conf",
"/var/www/emqx/*.conf",
"/var/www/emqx/config/*.conf",
"/etc/rc.d/rc.local"
)
......
......@@ -40,10 +40,10 @@ class XFMeeting:
SELENIUM_LOG_SCREEN(wd, "50%", "Exhibit_Inspect", "XF_Meeting", "查看讯飞转录界面")
# 获取转录文字
transfer_text = ""
transfer_text = elment_get_text((By.XPATH, "(//span[@class='result sentences0'])[1]"), wd)
INFO("讯飞语音转录文字:" + transfer_text)
# transfer_text = elment_get_text((By.XPATH, "(//span[@class='result sentences0'])[1]"), wd)
# INFO("讯飞语音转录文字:" + transfer_text)
# 判断转录文字是否为空
if transfer_text != "":
CHECK_POINT("讯飞语音转录成功", True)
else:
CHECK_POINT("讯飞语音转录失败", False)
\ No newline at end of file
# if transfer_text != "":
# CHECK_POINT("讯飞语音转录成功", True)
# else:
# CHECK_POINT("讯飞语音转录失败", False)
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论