From 9a19c25dff054c363fad8002a61b7f0e3e2c4439 Mon Sep 17 00:00:00 2001 From: kake26 Date: Sat, 24 Dec 2022 15:50:10 -0600 Subject: [PATCH] Ntfy support NTFY support added. --- Bash/OpenWrt/band.bash | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Bash/OpenWrt/band.bash b/Bash/OpenWrt/band.bash index 6e3e11b..76c7fa6 100644 --- a/Bash/OpenWrt/band.bash +++ b/Bash/OpenWrt/band.bash @@ -1,21 +1,18 @@ #!/bin/bash - # Requires vnstat to be running on target system # initial values - -# 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 +mtotal=1000 # monthly total in GB for high end cut off +dmax=40 # daily max usage value md=`date +%d` # day of the month numerically -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 +cmd=$(($dmax * $md)) # computed max daily +wif="wan" # now vnstat stuff, some of this is specific to openwrt -vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total daily usage -vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # monthly total usage +vnhourly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $6}'` # total monthly usage +vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # daily total usage -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 +logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly"; +curl -d "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly" 192.168.1.168:83/bandmon \ No newline at end of file