mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-08-31 05:52:52 +08:00
优化 PVE Ceph 软件源配置脚本
This commit is contained in:
+9
-7
@@ -75,21 +75,23 @@ EOF
|
|||||||
```bash
|
```bash
|
||||||
## 配置 PVE Ceph 免订阅软件源脚本
|
## 配置 PVE Ceph 免订阅软件源脚本
|
||||||
$ if [ -f /etc/apt/sources.list.d/ceph.sources ]; then
|
$ 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
|
if [ -z "$CEPH_CODENAME" ] || [ -z "${VERSION_CODENAME:-}" ]; then
|
||||||
echo "无法确定 Ceph 或 Debian 版本代号。" >&2
|
echo "Unable to determine Ceph or Debian codename." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
Types: deb
|
||||||
URIs: https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME
|
URIs: https://mirrors.ustc.edu.cn/proxmox/debian/ceph-$CEPH_CODENAME
|
||||||
Suites: $VERSION_CODENAME
|
Suites: $VERSION_CODENAME
|
||||||
Components: no-subscription
|
Components: no-subscription
|
||||||
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
|
Signed-By: /usr/share/keyrings/proxmox-archive-keyring.gpg
|
||||||
EOF
|
EOF
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
30 9 * * * /usr/bin/systemctl restart smartdns.service
|
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
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user