Jonathan Hart
Committed by Gerrit Code Review

Modify 'onos-setup-karaf clean' to copy package configs

Running onos-setup-karaf clean deletes the karaf directory and any custom configs
you may have put in there. This change allow a developer to put custom configs
in the usual place ($ONOS_ROOT/tools/package/{config,etc}/) and have them copied
automatically to the local Karaf installation.

Change-Id: I9d7feabdee8f8a89930b9955de610dc821d8fdbb
......@@ -23,6 +23,7 @@ function validateIp {
# Clean the previous Karaf directory if requested and if it exists.
if [ "$1" = "clean" ]; then
shift
CLEAN="true"
[ -d $KARAF_ROOT ] && rm -fr $KARAF_ROOT $STAGE/apps $STAGE/config
fi
......@@ -105,6 +106,12 @@ cat > $STAGE/config/tablets.json <<EOF
"partitions": { "p1": [ { "ip": "$IP", "id": "$IP", "tcpPort": 9876 }]}}
EOF
if [ "$CLEAN" = "true" ]; then
echo "Copying package configs..."
cp -r $ONOS_ROOT/tools/package/etc/* $KARAF_ROOT/etc/
cp -r $ONOS_ROOT/tools/package/config/* $STAGE/config/
fi
echo "Staging builtin apps..."
rm -fr $STAGE/apps
onos-stage-apps $STAGE/apps $KARAF_ROOT/system
......