From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 6C96EA045E for ; Fri, 31 May 2019 10:54:45 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 63DF92C60; Fri, 31 May 2019 10:54:45 +0200 (CEST) Received: from tama500.ecl.ntt.co.jp (tama500.ecl.ntt.co.jp [129.60.39.148]) by dpdk.org (Postfix) with ESMTP id ED3EE2C60 for ; Fri, 31 May 2019 10:54:43 +0200 (CEST) Received: from vc2.ecl.ntt.co.jp (vc2.ecl.ntt.co.jp [129.60.86.154]) by tama500.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id x4V8sgcY000704; Fri, 31 May 2019 17:54:42 +0900 Received: from vc2.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 9C9E3639615; Fri, 31 May 2019 17:54:42 +0900 (JST) Received: from localhost.localdomain (lobster.nslab.ecl.ntt.co.jp [129.60.13.95]) by vc2.ecl.ntt.co.jp (Postfix) with ESMTP id 8EADD639613; Fri, 31 May 2019 17:54:42 +0900 (JST) From: ogawa.yasufumi@lab.ntt.co.jp To: spp@dpdk.org, ferruh.yigit@intel.com, ogawa.yasufumi@lab.ntt.co.jp Date: Fri, 31 May 2019 17:52:09 +0900 Message-Id: <1559292729-26993-1-git-send-email-ogawa.yasufumi@lab.ntt.co.jp> X-Mailer: git-send-email 2.7.4 X-TM-AS-MML: disable Subject: [spp] [PATCH] bin: make template config as default X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" From: Yasufumi Ogawa Config file of startup script `bin/env.sh` is under management of git, but it is not convenient for developers if this file is changed and asked to `git add` even if subtle changes. This update is to add template config under the management of git and to use customized config which is not included under git. The startup script expects to find customized `bin/config.sh`, or create it by copying template `bin/sample/config.sh` if it does not exist. Signed-off-by: Yasufumi Ogawa --- .gitignore | 1 + bin/{env.sh => sample/config.sh} | 0 bin/start.sh | 15 +++++++++++++-- 3 files changed, 14 insertions(+), 2 deletions(-) rename bin/{env.sh => sample/config.sh} (100%) diff --git a/.gitignore b/.gitignore index b31ab54..34c2ea8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ *.swp *.pyc *.log +bin/config.sh docs/guides/_build/* docs/guides/images/**/*.pdf src/controller/3rd_party/* diff --git a/bin/env.sh b/bin/sample/config.sh similarity index 100% rename from bin/env.sh rename to bin/sample/config.sh diff --git a/bin/start.sh b/bin/start.sh index 6a6f304..9bc1ff0 100755 --- a/bin/start.sh +++ b/bin/start.sh @@ -8,10 +8,21 @@ # Activate for debugging #set -x -SPP_DIR=$(cd $(dirname $0); pwd)/.. +WORK_DIR=$(cd $(dirname $0); pwd) +SPP_DIR=${WORK_DIR}/.. + +DEFAULT_CONFIG=${WORK_DIR}/sample/config.sh +CONFIG=${WORK_DIR}/config.sh + +if [ ! -f ${CONFIG} ]; then + echo "Creating config file ..." + cp ${DEFAULT_CONFIG} ${CONFIG} + echo "Edit '${CONFIG}' and run this script again!" + exit +fi # import vars and functions -. ${SPP_DIR}/bin/env.sh +. ${CONFIG} echo "Start spp-ctl" python3 ${SPP_DIR}/src/spp-ctl/spp-ctl -b ${SPP_HOST_IP} \ -- 2.17.1