From 78e3f780715364a81cdbbc67a9799802a1155870 Mon Sep 17 00:00:00 2001 From: Stig Sandbeck Mathisen Date: Sat, 4 Oct 2014 22:05:54 +0200 Subject: [PATCH] Use UNIX line breaks --- plugins/ups/apc_status | 66 +++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/plugins/ups/apc_status b/plugins/ups/apc_status index 586803ac..fee73ff5 100755 --- a/plugins/ups/apc_status +++ b/plugins/ups/apc_status @@ -1,33 +1,33 @@ -#!/bin/sh -# -# (c) Andreas Kreisl -# -# Link name will be used as title: apc_{$title} -# -# env.keys LOADPCT BCHARGE LINEV BATTV TIMELEFT -# env.unit % or Volt or Minutes -# - - -if [ -z "$keys" ]; then - keys="TIMELEFT" -fi - -if [ "$1" = "config" ]; then - title=`basename $0 | sed 's/^apc_//g' | awk '{ sub(/^./,toupper(substr($0,1,1))); print; }'` - echo "graph_title APC Status - $title" - echo 'graph_args --base 1000 -l 0 ' - echo "graph_vlabel $unit" - echo 'graph_category sensors' - title=`/sbin/apcaccess | egrep "^MODEL" | awk '{print $3" "$4" "$5" "$6" "$7" "$8" "$9;}'` - echo "graph_info $title" - for key in $keys; do - echo "$key.label $key" - echo "$key.info Value of $key." - echo "$key.draw LINE2" - done - exit 0 -fi - -searchkey=`echo "$keys" | tr " " "\|"` -/sbin/apcaccess | egrep "$searchkey" | awk '{print $1".value "$3;}' +#!/bin/sh +# +# (c) Andreas Kreisl +# +# Link name will be used as title: apc_{$title} +# +# env.keys LOADPCT BCHARGE LINEV BATTV TIMELEFT +# env.unit % or Volt or Minutes +# + + +if [ -z "$keys" ]; then + keys="TIMELEFT" +fi + +if [ "$1" = "config" ]; then + title=`basename $0 | sed 's/^apc_//g' | awk '{ sub(/^./,toupper(substr($0,1,1))); print; }'` + echo "graph_title APC Status - $title" + echo 'graph_args --base 1000 -l 0 ' + echo "graph_vlabel $unit" + echo 'graph_category sensors' + title=`/sbin/apcaccess | egrep "^MODEL" | awk '{print $3" "$4" "$5" "$6" "$7" "$8" "$9;}'` + echo "graph_info $title" + for key in $keys; do + echo "$key.label $key" + echo "$key.info Value of $key." + echo "$key.draw LINE2" + done + exit 0 +fi + +searchkey=`echo "$keys" | tr " " "\|"` +/sbin/apcaccess | egrep "$searchkey" | awk '{print $1".value "$3;}'