add: 提交

This commit is contained in:
lichang committed 2023-08-14 17:02:50 +08:00
1 parent 897d45d443
commit 5ac2e981ea
163 files changed
+29466

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
#!/bin/bash
threshold=99 # 设置硬盘使用率的阈值
disk_usage=$(df -h | awk '$NF=="/"{print $(NF-1)}' | sed 's/%//') # 获取根目录的硬盘使用率
if [ $disk_usage -gt $threshold ]; then
echo "Disk usage is above $threshold%. Taking action..."
systemctl restart keepalived
fi