From f674b8af03102d71ead1ccc2b81c46789b08c5e0 Mon Sep 17 00:00:00 2001
From: tteckster <tteckster@gmail.com>
Date: Fri, 9 Feb 2024 17:41:00 -0500
Subject: [PATCH] Update adguard.sh

fixes https://github.com/tteck/Proxmox/issues/2462
---
 ct/adguard.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ct/adguard.sh b/ct/adguard.sh
index e9e667c9..b7a8fdd5 100644
--- a/ct/adguard.sh
+++ b/ct/adguard.sh
@@ -56,6 +56,10 @@ function default_settings() {
 function update_script() {
 header_info
 if [[ ! -d /opt/AdGuardHome ]]; then msg_error "No ${APP} Installation Found!"; exit; fi
+if (( $(df /boot | awk 'NR==2{gsub("%","",$5); print $5}') > 80 )); then
+  read -r -p "Warning: Storage is dangerously low, continue anyway? <y/N> " prompt
+  [[ ${prompt,,} =~ ^(y|yes)$ ]] || exit
+fi
 wget -qL https://static.adguard.com/adguardhome/release/AdGuardHome_linux_amd64.tar.gz
 msg_info "Stopping AdguardHome"
 systemctl stop AdGuardHome