Copied code from the bash framework and add json based config file support

This commit is contained in:
kake26 2023-12-09 22:37:59 -06:00
parent 3ccf356c11
commit 6d893a43a6
3 changed files with 78 additions and 10 deletions

View file

@ -1,6 +1,19 @@
#!/bin/bash
# Requires vnstat to be running on target system
set -eo pipefail # you cann add u into -eo, but it drives me nuts so I won't
if [[ -n "${BASHD_DEBUG}" ]]; then # a inevitability that this will be used
set -x
fi
trap cleanup EXIT # A little more robust cleanup
cleanup() {
# We can clean up any temp files or what nots, but for now a place holder
true
}
# initial values
mtotal=1000 # monthly total in GB for high end cut off
dmax=40 # daily max usage value