Commit ba8760a5 authored by Chris Croome's avatar Chris Croome

Checks added to Kate's bandwidth script

parent 4756ee01
Pipeline #7445 passed with stage
in 21 seconds
......@@ -5,12 +5,24 @@ logfiles=/var/log/apache2/
rcpts="$1"
host=$(hostname -f)
# Make a private TMP directory for data processing
if [[ ! -d "${data_tmp}" ]]; then
mkdir -p "${data_tmp}"
fi
chmod 700 "${data_tmp}"
# Check for email address as first argument
if [[ ! "${1}" ]]; then
echo "Please supply an email address as the first argument"
exit 1
fi
# Identify users.
## Do this by looking at apache configuration and using that to build a list of users
## Why this way ... well it's apache we need to be thinking about ? so it seems as good an
## any other way to do it
users=$(grep AssignUserID /etc/apache2/sites-available/*conf | awk '{print $3}' | sort | uniq )
users=$(ls /etc/apache2/sites-enabled/*conf | sed 's;^/etc/apache2/sites-enabled/;;' | sed 's/\.conf$//' | sort | uniq )
report="User RX_GiBYTES TX_GiBYTES TOTAL_GiBYTES\n-----------------------\n"
for user in $users
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment