优化 PVE Ceph 软件源配置脚本

This commit is contained in:
CallMeR
2026-08-14 01:20:39 +08:00
parent e37d437f0f
commit fcc5c2b019
2 changed files with 10 additions and 8 deletions
+9 -7
View File
@@ -75,21 +75,23 @@ EOF
```bash
## 配置 PVE Ceph 免订阅软件源脚本
$ if [ -f /etc/apt/sources.list.d/ceph.sources ]; then
. /etc/os-release
CEPH_CODENAME=$(ceph -v | awk '/^ceph version / { print $(NF - 1); exit }')
(
. /etc/os-release
CEPH_CODENAME=$(ceph -v | awk '/^ceph version / { print $(NF - 1); exit }')
if [ -z "$CEPH_CODENAME" ] || [ -z "${VERSION_CODENAME:-}" ]; then
echo "无法确定 Ceph Debian 版本代号。" >&2
exit 1
fi
if [ -z "$CEPH_CODENAME" ] || [ -z "${VERSION_CODENAME:-}" ]; then
echo "Unable to determine Ceph or Debian codename." >&2
exit 1
fi
tee /etc/apt/sources.list.d/pve-ceph-no-subscription.sources >/dev/null <<EOF
tee /etc/apt/sources.list.d/pve-ceph-no-subscription.sources >/dev/null <<EOF
Types: deb
URIs: https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME
Suites: $VERSION_CODENAME
Components: no-subscription
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
EOF
)
fi
```
+1 -1
View File
@@ -6,7 +6,7 @@
30 9 * * * /usr/bin/systemctl restart smartdns.service
## Or when the smartdns plugin is installed
## Or when the SmartDNS China List installer is installed
20 9 * * * /usr/bin/curl --retry-connrefused --retry 5 --retry-delay 5 --retry-max-time 60 -fsSLR -o /etc/smartdns.d/anti-ad.smartdns.conf https://anti-ad.net/anti-ad-for-smartdns.conf