Projet

Général

Profil

Révision e68a0308

IDe68a0308fe6d7cc7ee10b255fc0f359afa183b96
Parent be192b52
Enfant 94434e4b

Ajouté par Lars Kruse il y a plus de 6 ans

Plugin zfs-filesystem-graph: fix autoconf and remove "suggest"

Voir les différences:

plugins/zfs/zfs-filesystem-graph
20 20
# ** WARNING **
21 21
# For now this plugin does not allow "_" in the name of a zpool or filesystems
22 22
#
23
#  #%# capabilities=autoconf
24
#
23 25

  
24 26
myname=$(basename "$0" | sed 's/^zfs_fs_//g' | sed -e 's/_/\//g')
25 27

  
26 28
if [ "$1" = "autoconf" ]; then
27
    # Makes little sense to autoconf if you can't suggest
28
    echo no
29
    if which zfs >/dev/null; then
30
        echo yes
31
    else
32
        echo "no (missing executable 'zfs')"
33
    fi
29 34
    exit 0
30 35
fi
31 36

  
32
if [ "$1" = "suggest" ]; then
33
	exit 0
34
fi
35 37

  
36 38
read -r -a values <<<"$(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota "$myname" \
37 39
    | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}')"

Formats disponibles : Unified diff