Fix yq
This commit is contained in:
parent
1a41a66355
commit
1a4ca0ed07
2 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ class sunetdrive::script (
|
||||||
$location = undef
|
$location = undef
|
||||||
) {
|
) {
|
||||||
include sunet::packages::python3_pip
|
include sunet::packages::python3_pip
|
||||||
include sunet::packages::kopia
|
include sunet::packages::yq
|
||||||
$environment = sunetdrive::get_environment()
|
$environment = sunetdrive::get_environment()
|
||||||
$customer = sunetdrive::get_customer()
|
$customer = sunetdrive::get_customer()
|
||||||
$apikey_test = safe_hiera('monitor_apikey_test')
|
$apikey_test = safe_hiera('monitor_apikey_test')
|
||||||
|
|
|
@ -9,16 +9,16 @@ aggregatefile="billing-$(date +%Y%m%d).csv"
|
||||||
tempdir=$(mktemp -d)
|
tempdir=$(mktemp -d)
|
||||||
|
|
||||||
# Install yq if needed
|
# Install yq if needed
|
||||||
yq="/usr/local/bin/yq"
|
yq="/usr/bin/yq"
|
||||||
if ! [[ -x ${yq} ]]; then
|
if ! [[ -x ${yq} ]]; then
|
||||||
pip3 install yq
|
apt install yq
|
||||||
fi
|
fi
|
||||||
|
|
||||||
olddir=${PWD}
|
olddir=${PWD}
|
||||||
cd "${tempdir}" || (echo "could not move to tempdir" && exit 1)
|
cd "${tempdir}" || (echo "could not move to tempdir" && exit 1)
|
||||||
|
|
||||||
# Make sure we have dir
|
# Make sure we have dir
|
||||||
rclone mkdir -p "${aggregatedir}"
|
rclone mkdir "${aggregatedir}"
|
||||||
# Output headers
|
# Output headers
|
||||||
csv="DATE:$(date +%F) TIME:$(date +%H:%M)
|
csv="DATE:$(date +%F) TIME:$(date +%H:%M)
|
||||||
Customer;Total GB;Users;Product"
|
Customer;Total GB;Users;Product"
|
||||||
|
|
Loading…
Add table
Reference in a new issue