Config support for band.bash

This commit is contained in:
kake26 2023-12-17 22:29:33 -06:00
parent 6d893a43a6
commit 8ab998e252

View file

@ -14,12 +14,15 @@ cleanup() {
true true
} }
source ./config.bash
# initial values # initial values
mtotal=1000 # monthly total in GB for high end cut off mtotal=1000 # monthly total in GB for high end cut off
dmax=40 # daily max usage value dmax=40 # daily max usage value
md=`date +%d` # day of the month numerically md=`date +%d` # day of the month numerically
cmd=$(($dmax * $md)) # computed max daily cmd=$(($dmax * $md)) # computed max daily
wif="wan" wif="wan"
token=$(read_json "$JSON_FILE" "ntfy" "token")
# now vnstat stuff, some of this is specific to openwrt # now vnstat stuff, some of this is specific to openwrt
@ -29,3 +32,4 @@ vnmonthly=`vnstat -i $wif -d -s --oneline | awk -F\; '{print $11}'` # daily tota
logger "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly"; 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 curl -d "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly" 192.168.1.168:83/bandmon
curl -H "Authorization: Bearer $token" -d "dom $md cm $cmd vnhourly $vnhourly vnmonthly $vnmonthly" https://pngpst.net/openwrt_lan