#!/bin/sh

if [ "$1" == "" ]; then
	echo "Error: First parameter should be instance name"
	exit 1
fi

if [ "$2" == "" ]; then
	echo "Error: Second parameter should be variable name"
	exit 1
fi

if [ "$3" == "" ]; then
	echo "Error: Third parameter should be variable value"
	exit 1
fi

cli command cfgmgr-0:begin_transaction $1 >> /dev/null

cli set $1:$2 $3

cli command cfgmgr-0:commit $1 >> /dev/null
cli command cfgmgr-0:end_transaction $1 >> /dev/null
cli command cfgmgr-0:save >> /dev/null
cli command $1:apply >> /dev/null

