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

[openvz_] Shell code style (quoting, backticks, indentation)

This commit is contained in:
Lars Kruse 2016-10-17 03:03:46 +02:00
parent 1655f82033
commit 8b07fa2dc7

View file

@ -15,7 +15,7 @@
#%# family=auto
#%# capabilities=autoconf suggest
ATTRIBUTE=`basename $0 | sed 's/^openvz_//g'`
ATTRIBUTE=$(basename "$0" | sed 's/^openvz_//g')
if [ "$1" = "autoconf" ]; then
@ -41,8 +41,8 @@ if [ "$1" = "config" ]; then
echo "graph_category openvz"
echo "graph_info This graph shows OpenVZ: $ATTRIBUTE"
vzlist -a -H --no-trim -o hostname | awk '{gsub(/\./,"_",$1)
print("'$ATTRIBUTE'"$1".label "$1"\n" \
"'$ATTRIBUTE'"$1".info '$ATTRIBUTE' for VE"$1)}'
print("'$ATTRIBUTE'"$1".label "$1"\n" \
"'$ATTRIBUTE'"$1".info '$ATTRIBUTE' for VE"$1)}'
exit 0
fi
@ -51,7 +51,7 @@ filter() { cat; }
[ "$ATTRIBUTE" = 'status' ] && filter() { sed -e 's/running/10/g;s/stopped/0/g'; }
#TODO: filter for uptime
vzlist -a -H --no-trim -o hostname,$ATTRIBUTE | filter | awk '{gsub(/\./,"_",$1)
vzlist -a -H --no-trim -o "hostname,$ATTRIBUTE" | filter | awk '{gsub(/\./,"_",$1)
print("'$ATTRIBUTE'"$1".value "$2)}'
exit 0