Config Tree API

I am using the the cfg interface to have some application specific configuration data. An issue that I see is that every time I upgrade the application the configuration data is lost. At the moment I use “config export” and “config import” as a workaround.

Is it supposed to be like this?

Hello,

Currently the upgrade process is to first uninstall the application, which includes it’s private config tree. Then to install the new version of the application as a seperate step. The problem here of course is that the installer really has no concept of an upgrade.

We are looking at enhancing the process to properly upgrade in place so that assets like app specific config trees are not lost.

Unfortuanly at this time the best workaround is to import and export your config as you have found. If you are installing your app through the command line, you can wrap instapp in a shell script that can automate this for you:

[code]#!/bin/bash

APP_NAME=$1

if [ -z “$APP_NAME” ]
then
>&2 echo “Application name not specified.”
exit 1
fi

if [ -z “$2” ]
then
if [ -z “$DEST_IP” ]
then
>&2 echo “Device IP address not specified.”
exit 1
fi
DEVICE_IP=$DEST_IP
else
DEVICE_IP=$2
fi

function cfg
{
CMD=$1
#echo "Test: "
ssh root@$DEVICE_IP “/usr/local/bin/config $CMD $APP_NAME:/ ~/$APP_NAME.cfg”
}

cfg export
instapp $APP_NAME.ar7 $DEVICE_IP
cfg import
[/code]

If you save this script as inst.sh, you can run it as follows:

$ inst.sh <myApp> <myDeviceIP>

or

$ export DEST_IP=<myDeviceIP> $ inst.sh myApp

-Kelly