UpdateController/load_tariff

17 lines
448 B
Plaintext
Raw Normal View History

2022-06-02 17:30:43 +02:00
#! /bin/bash -
# set -x
if [ $# -eq 2 ]; then
if [ -f $1 ]; then
out="\"VERSION\":\"$(cat $1 | jq -r .version)\"",
out+="\"PROJECT\":\"$(cat $1 | jq -r .project)\"",
out+="\"ZONE\":$(cat $1 | jq -r .zone)",
out+="\"INFO\":\"$(cat $1 | jq -r .info)\"",
out+="\"LOADED\":\"$(date +%Y-%m-%dT%T)\""
echo $out > $2
exit $?
fi
fi
echo "Usage: ./${0##*/} <tariff.config> <tariff.current>"