cleanup: 清理项目中的额外产物和临时文件

清理内容:
- 删除fscan-lite目录下的编译产物(.o文件)
- 移除临时测试脚本pull_images.sh
- 更新.gitignore,添加*.o和*.a编译对象文件规则

代码仓库整洁原则:
- 版本控制不应包含编译产物
- 临时脚本和测试文件不应提交
- .gitignore应覆盖所有可能的构建产物

影响:
- 减少仓库大小,避免无意义的文件变更
- 防止编译产物冲突和平台相关问题
- 保持代码仓库的专业性和整洁性
This commit is contained in:
ZacharyZcR 2025-09-02 01:15:08 +00:00
parent 85a9c5e163
commit 94ead622e2
5 changed files with 4 additions and 123 deletions

4
.gitignore vendored
View File

@ -75,3 +75,7 @@ Todo列表.md
cleanup.bat cleanup.bat
cleanup.sh cleanup.sh
cleanup_script_* cleanup_script_*
# Compilation objects / 编译对象文件
*.o
*.a

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,123 +0,0 @@
#!/bin/bash
# Fscan 测试镜像拉取脚本
# 排除 IMAP、POP3、Modbus 相关镜像
echo "=== Fscan 测试镜像拉取开始 ==="
echo "排除服务: IMAP, POP3, Modbus"
echo ""
# 基础镜像列表
images=(
# 数据库服务
"mysql:latest"
"postgres:latest"
"mongo:latest"
"redis:5.0.1"
"mcr.microsoft.com/mssql/server:2022-latest"
"neo4j:4.4"
"memcached:latest"
"cassandra:3.11"
# Web服务
"tomcat:9.0-jdk8"
"container-registry.oracle.com/middleware/weblogic:12.2.1.4-dev"
# 搜索引擎
"docker.elastic.co/elasticsearch/elasticsearch:7.9.3"
# 消息队列
"rabbitmq:3-management"
"rmohr/activemq:5.15.9"
"bitnami/kafka:latest"
# 监控系统
"zabbix/zabbix-server-mysql:ubuntu-6.0.23"
"zabbix/zabbix-web-nginx-mysql:ubuntu-6.0.23"
# 目录服务
"osixia/openldap:1.5.0"
# 网络服务
"bogem/ftp"
"ubuntu:latest" # SSH, SMTP, SNMP, Rsync, VNC, Telnet
"ubuntu:20.04" # SSH, SMTP, SNMP, Rsync, VNC, Telnet
"busybox:latest" # Telnet
)
# 记录成功和失败的镜像
success_count=0
failed_images=()
total_images=${#images[@]}
echo "需要拉取 $total_images 个镜像"
echo ""
# 拉取镜像函数
pull_image() {
local image=$1
local current=$2
local total=$3
echo "[$current/$total] 拉取镜像: $image"
# 设置超时和重试
local max_retries=3
local retry=0
while [ $retry -lt $max_retries ]; do
if timeout 300 docker pull "$image"; then
echo "✓ 成功: $image"
((success_count++))
return 0
else
((retry++))
if [ $retry -lt $max_retries ]; then
echo "⚠ 重试 $retry/$max_retries: $image"
sleep 5
fi
fi
done
echo "✗ 失败: $image (超时或网络错误)"
failed_images+=("$image")
return 1
}
# 开始拉取
start_time=$(date +%s)
for i in "${!images[@]}"; do
current=$((i + 1))
pull_image "${images[$i]}" "$current" "$total_images"
echo ""
done
# 统计结果
end_time=$(date +%s)
duration=$((end_time - start_time))
failed_count=${#failed_images[@]}
echo "=== 拉取完成 ==="
echo "总镜像数: $total_images"
echo "成功: $success_count"
echo "失败: $failed_count"
echo "用时: ${duration}s"
echo ""
# 显示失败的镜像
if [ $failed_count -gt 0 ]; then
echo "失败的镜像:"
for image in "${failed_images[@]}"; do
echo " - $image"
done
echo ""
echo "可以重新运行脚本来重试失败的镜像"
fi
# 检查 Docker 存储空间
echo "=== Docker 存储使用情况 ==="
docker system df
echo ""
echo "脚本执行完成!"