17 lines
448 B
Bash
Executable File
17 lines
448 B
Bash
Executable File
#! /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>"
|