Add helper script load_tariff
This commit is contained in:
		
							
								
								
									
										16
									
								
								load_tariff
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										16
									
								
								load_tariff
									
									
									
									
									
										Executable 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>"
 | 
			
		||||
		Reference in New Issue
	
	Block a user