灵感来源:https://t.me/Luca_VPS/209
适用于almalinux的脚本,功能为每月流量达到指定上限后停止指定容器,运行方法:
1、自行安装 vnstat 和 bc ,并对脚本提权
2、
bash ecs.sh 流量上限(单位GB) 容器名(支持多个容器名)例:
bash ecs.sh 95 snell singbox dnsproxy3、加入crontab自动运行:
0 * * * * /bin/bash /root/ecs.sh 95 snell singbox dnsproxy路径请根据实际情况修改
可用于流量较少的服务器,如阿里云ecs、Azure等,防止流量超标导致额外付费