X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ta%2Fdistributed-state-server.git;a=blobdiff_plain;f=src%2Fdss%2Ftst%2Fstart-server.sh;fp=src%2Fdss%2Ftst%2Fstart-server.sh;h=4825cb1297bf35006fc5fe944159ae5312b5400a;hp=0000000000000000000000000000000000000000;hb=bd5a0a173f1ae9c64782fbf47565cc26ed23b448;hpb=03589032bfdfba119409e7c1c5bfa82ca52f53f7 diff --git a/src/dss/tst/start-server.sh b/src/dss/tst/start-server.sh new file mode 100755 index 0000000..4825cb1 --- /dev/null +++ b/src/dss/tst/start-server.sh @@ -0,0 +1,73 @@ +#! /bin/bash +# Copyright 2019 Nokia +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + + +cwd=$(pwd) + +if [ $# -ne 1 ]; then + echo "Usage: $0 " +fi + +workdir=$1 + +echo "Creating work dir $workdir" +mkdir $workdir +if [ $? -ne 0 ]; then + exit 1 +fi + +echo "Copying dss-server-config.ini file" +cp $cwd/dss-server-config.ini $workdir/ +if [ $? -ne 0 ]; then + exit 1 +fi + +echo "Copying plugin.ini file" +cp $cwd/plugin.ini $workdir/ +if [ $? -ne 0 ]; then + exit 1 +fi + +echo "Copying plugin" +cp ../../../../plugins/dssfile.py $workdir/ + +echo "Updating dss-server-config.ini" +pluginfile=$workdir/dssfile.py +escapepluginfile=$(echo $pluginfile | sed 's/\//\\\//g') +sed -i "s/PLUGIN_FILE/$escapepluginfile/g" $workdir/dss-server-config.ini +if [ $? -ne 0 ]; then + exit 1 +fi + +echo "Updating plugin.ini" +pluginconf=$workdir/plugin.ini +escapepluginconf=$(echo $pluginconf | sed 's/\//\\\//g') +sed -i "s/PLUGIN_CONF/$escapepluginconf/g" $workdir/dss-server-config.ini + +files=$workdir/files +escapefiles=$(echo $files | sed 's/\//\\\//g') +mkdir $files +if [ $? -ne 0 ]; then + exit 1 +fi + +sed -i "s/DIR/$escapefiles/g" $workdir/plugin.ini + + + +export PYTHONPATH=$cwd/../../../ + +exec python $cwd/../server/dss_main.py --config $workdir/dss-server-config.ini