summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2014-03-15 03:37:25 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2014-03-15 03:37:25 -0700
commit407eddf258f4ebb9c2c86e90832b1e7fe9dfa8f9 (patch)
treeef60cd3010eaa7f98bdeed001010c897d9918204 /sbin
parent8823d904b7e7b902af6c0fb44dc1d726278f732d (diff)
downloadiptables-rrdtool-407eddf258f4ebb9c2c86e90832b1e7fe9dfa8f9.tar.gz
iptables-rrdtool-407eddf258f4ebb9c2c86e90832b1e7fe9dfa8f9.zip
sbin/iptables-rrdtool: clean up repeat lines with a loop
Diffstat (limited to 'sbin')
-rw-r--r--sbin/iptables-rrdtool7
1 files changed, 3 insertions, 4 deletions
diff --git a/sbin/iptables-rrdtool b/sbin/iptables-rrdtool
index 70c56e8..2cbbf00 100644
--- a/sbin/iptables-rrdtool
+++ b/sbin/iptables-rrdtool
@@ -43,10 +43,9 @@ for table in $(cat /proc/net/ip_tables_names); do
rrdtool update "${RRDDIR}/${name}.rrd" "N:${counter}"
if [ "${GENPNG}" = "1" ]; then
- rrdtool graph "${PNGDIR}/${name}:d.png" --full-size-mode -w 640 -h 480 --units=si --logarithmic --start -1d DEF:rule="${RRDDIR}/${name}.rrd":rule:AVERAGE LINE1:rule#0080ff:rule VDEF:total=rule,TOTAL GPRINT:total:Total\\\:%8.3lf\ %s
- rrdtool graph "${PNGDIR}/${name}:w.png" --full-size-mode -w 640 -h 480 --units=si --logarithmic --start -1w DEF:rule="${RRDDIR}/${name}.rrd":rule:AVERAGE LINE1:rule#0080ff:rule VDEF:total=rule,TOTAL GPRINT:total:Total\\\:%8.3lf\ %s
- rrdtool graph "${PNGDIR}/${name}:m.png" --full-size-mode -w 640 -h 480 --units=si --logarithmic --start -1m DEF:rule="${RRDDIR}/${name}.rrd":rule:AVERAGE LINE1:rule#0080ff:rule VDEF:total=rule,TOTAL GPRINT:total:Total\\\:%8.3lf\ %s
- rrdtool graph "${PNGDIR}/${name}:y.png" --full-size-mode -w 640 -h 480 --units=si --logarithmic --start -1y DEF:rule="${RRDDIR}/${name}.rrd":rule:AVERAGE LINE1:rule#0080ff:rule VDEF:total=rule,TOTAL GPRINT:total:Total\\\:%8.3lf\ %s
+ for interval in d w m y; do
+ rrdtool graph "${PNGDIR}/${name}:${interval}.png" --full-size-mode -w 640 -h 480 --units=si --logarithmic --start -1${interval} DEF:rule="${RRDDIR}/${name}.rrd":rule:AVERAGE LINE1:rule#0080ff:rule VDEF:total=rule,TOTAL GPRINT:total:Total\\\:%8.3lf\ %s
+ done
fi
fi
done