更新 choose-cn-v2.sh

This commit is contained in:
chunzhi 2024-02-08 14:26:23 +08:00
parent 055d510289
commit 252ddadddb

View File

@ -1,5 +1,21 @@
#!/bin/bash
# 检查并安装依赖项 jq 和 bc
if ! command -v jq &> /dev/null
then
echo "jq could not be found, installing now..."
sudo apt-get update && sudo apt-get install -y jq
fi
if ! command -v bc &> /dev/null
then
echo "bc could not be found, installing now..."
sudo apt-get update && sudo apt-get install -y bc
fi
# 输出设置 crontab 的命令
echo "To run this script every day at 3 AM, add the following line to your crontab:"
echo "0 3 * * * /path/to/this/script.sh"
# 测速脚本部分
# 使用 dig 命令查询 DNS 记录并写入 ip.txt
dig cf.youoffer.net A +short > ip.txt