2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

plugin ipset: fix shellcheck issues

This commit is contained in:
Lars Kruse 2018-04-18 04:04:15 +02:00
parent dfc68cb21a
commit 919991eef3

View File

@ -46,25 +46,33 @@ GPLv2
=cut =cut
[ "$1" = "autoconf" ] && { get_ipset_list() {
[ -e /sbin/ipset -o -n "$(which ipset)" ] && echo 'yes' || echo 'no (ipset binary not present)' ipset list -n
exit 0
} }
[ "$1" = "config" ] && {
if [ "$1" = "autoconf" ]; then
if [ -e /sbin/ipset ] || [ -n "$(which ipset)" ]; then
echo 'yes'
else
echo 'no (ipset binary not present)'
fi
exit 0
fi
if [ "$1" = "config" ]; then
echo graph_title Netfilter IPSets echo graph_title Netfilter IPSets
echo graph_category network echo graph_category network
echo graph_vlabel Members echo graph_vlabel Members
echo graph_args --base 1000 --logarithmic --units=si echo graph_args --base 1000 --logarithmic --units=si
} get_ipset_list | while read -r list; do
ipset list -n | while read list; do
[ "$1" = "config" ] && {
echo "$list.label $list" echo "$list.label $list"
echo "$list.min 0" echo "$list.min 0"
} || { done
echo "$list.value $(( $(ipset list "$list" | wc -l) - 7 ))" exit 0
} fi
done;
get_ipset_list | while read -r list; do
echo "$list.value $(( $(ipset list "$list" | wc -l) - 7 ))"
done
exit 0 exit 0