Add helper script load_tariff

This commit is contained in:
Gerhard Hoffmann 2022-06-02 17:30:43 +02:00
parent f70e4946d7
commit bcb961fc95

16
load_tariff Executable file
View File

@ -0,0 +1,16 @@
#! /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>"