1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

Fix multiple shellcheck issues

This commit is contained in:
Lars Kruse 2019-08-13 03:59:54 +02:00
parent 5b1099fb83
commit 7fed3b9765
18 changed files with 59 additions and 50 deletions

View file

@ -21,7 +21,7 @@
# For now this plugin does not allow "_" in the name of a zpool or filesystems
#
myname=`basename $0 | sed 's/^zfs_fs_//g' | sed -e 's/_/\//g'`
myname=$(basename "$0" | sed 's/^zfs_fs_//g' | sed -e 's/_/\//g')
if [ "$1" = "autoconf" ]; then
# Makes little sense to autoconf if you can't suggest
@ -33,7 +33,9 @@ if [ "$1" = "suggest" ]; then
exit 0
fi
values=( $(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota $myname | awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}') )
read -r -a values <<<"$(zfs get -p usedbydataset,usedbychildren,usedbysnapshots,usedbyrefreservation,available,quota "$myname" \
| awk 'BEGIN {total=0;} { if( NR==1 ) next; } !/quota/ {total=total+$3;} {print $3} END{print total;}')"
if [ "$1" = "config" ]; then