Commit e89eb607f5579e8391f0ce630c498c11880cba3d

Authored by Imanol-Mikel Barba Sabariego
1 parent 3a244ae1

Using same stats command with sudo

Showing 1 changed file with 2 additions and 2 deletions
check_btrfs/check_btrfs.sh
... ... @@ -7,7 +7,7 @@ function smart_disks() {
7 7 fi
8 8  
9 9 POOL=$1
10   - DISKS=$(btrfs device stats / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u)
  10 + DISKS=$(sudo btrfs device stats -c / | grep -oP "^\[[^\]]+\]" | sed 's/[][]//g' | sort -u)
11 11 ERR_OUTPUT=""
12 12 HIGHEST_RES=0
13 13 for disk in $DISKS; do
... ... @@ -50,7 +50,7 @@ function pool_errors() {
50 50 return 3
51 51 fi
52 52  
53   - OUTPUT="$(btrfs device stats -c $1)"
  53 + OUTPUT="$(sudo btrfs device stats -c $1)"
54 54 STATUS=$?
55 55  
56 56 if [[ $STATUS != 0 ]]; then
... ...