From e89eb607f5579e8391f0ce630c498c11880cba3d Mon Sep 17 00:00:00 2001 From: Imanol-Mikel Barba Sabariego Date: Mon, 1 Apr 2024 15:24:18 +0200 Subject: [PATCH] Using same stats command with sudo --- check_btrfs/check_btrfs.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_btrfs/check_btrfs.sh b/check_btrfs/check_btrfs.sh index 3b3ec95..46d48d5 100755 --- a/check_btrfs/check_btrfs.sh +++ b/check_btrfs/check_btrfs.sh @@ -7,7 +7,7 @@ function smart_disks() { fi POOL=$1 - DISKS=$(btrfs device stats / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u) + DISKS=$(sudo btrfs device stats -c / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u) ERR_OUTPUT="" HIGHEST_RES=0 for disk in $DISKS; do @@ -50,7 +50,7 @@ function pool_errors() { return 3 fi - OUTPUT="$(btrfs device stats -c $1)" + OUTPUT="$(sudo btrfs device stats -c $1)" STATUS=$? if [[ $STATUS != 0 ]]; then -- libgit2 0.22.2