Bash code comment clarification

This commit is contained in:
Paul M 2021-05-03 22:32:57 -05:00
parent 1ef62a2da9
commit 601575e1c0
2 changed files with 10 additions and 8 deletions

View file

@ -3,11 +3,13 @@
# Requires vnstat to be running on target system
# initial values
mtotal=1000 # monthly total in GB for high end cut off
dmax=40 # daily max usage value
# Note comcast caps at 1.2 TB
mtotal=1000 # Monthly warning threshold
dmax=40 # daily max usage value, trouble might arise if I go past 40 GB a day
md=`date +%d` # day of the month numerically
cmd=$(($dmax * $md)) # computed max daily
wif="eth1.2"
cmd=$(($dmax * $md)) # computed max daily, not hard value but can indicate a problem
wif="eth1.2" # interface to ask vnstat for, in my case the default wan vlan in Openwrt
# now vnstat stuff, some of this is specific to openwrt
@ -15,4 +17,5 @@ vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total daily
vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # monthly total usage
logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly";
logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly"; # Remeber the local syslog on OpenWrt is setup to log to a remote system
# therefore this is a lazy way to send the data out