From f0bf0a84c0844414c176fa6a67c3e1b95ad362ae Mon Sep 17 00:00:00 2001 From: "yang.zhenzhen" Date: Wed, 8 Mar 2017 17:30:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=8F=90=E4=BE=9B=E6=A0=B7=E5=88=97=EF=BC=8C=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E8=BF=90=E8=A1=8C=E6=97=B6=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=BB=8E=E9=A1=B9=E7=9B=AE=E4=B8=AD=E6=8F=90=E5=87=BA=EF=BC=8C?= =?UTF-8?q?=E5=BF=BD=E7=95=A5=EF=BC=9B=E9=98=B2=E6=AD=A2=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E5=8C=96=E7=9A=84=E9=85=8D=E7=BD=AE=E5=8A=A0=E5=85=A5=E5=88=B0?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ Makefile | 8 ++++++-- conf/{nginx.conf => nginx.conf.example} | 0 conf/{orange.conf => orange.conf.example} | 0 4 files changed, 8 insertions(+), 2 deletions(-) rename conf/{nginx.conf => nginx.conf.example} (100%) rename conf/{orange.conf => orange.conf.example} (100%) mode change 100755 => 100644 diff --git a/.gitignore b/.gitignore index dfb4fab4..a48492ef 100644 --- a/.gitignore +++ b/.gitignore @@ -82,3 +82,5 @@ nbproject Thumbs.db +/conf/nginx.conf +/conf/orange.conf diff --git a/Makefile b/Makefile index b74a4cb1..adbc0cdf 100644 --- a/Makefile +++ b/Makefile @@ -3,11 +3,15 @@ ORANGE_HOME ?= /usr/local/orange ORANGE_BIN ?= /usr/local/bin/orange .PHONY: test install show +init-config: + @cp conf/nginx.conf.example conf/nginx.conf + @cp conf/orange.conf.example conf/orange.conf + test: @echo "to be continued..." -install: +install:init-config @rm -rf $(ORANGE_BIN) @rm -rf $(ORANGE_HOME) @mkdir -p $(ORANGE_HOME) @@ -15,7 +19,7 @@ install: @for item in $(TO_INSTALL) ; do \ cp -a $$item $(ORANGE_HOME)/; \ done; - + @cat $(ORANGE_HOME)/conf/nginx.conf | sed "s/..\/\?.lua;\/usr\/local\/lor\/\?.lua;;/\/usr\/local\/orange\/\?.lua;\/usr\/local\/lor\/?.lua;;/" > $(ORANGE_HOME)/conf/new_nginx.conf @rm $(ORANGE_HOME)/conf/nginx.conf @mv $(ORANGE_HOME)/conf/new_nginx.conf $(ORANGE_HOME)/conf/nginx.conf diff --git a/conf/nginx.conf b/conf/nginx.conf.example similarity index 100% rename from conf/nginx.conf rename to conf/nginx.conf.example diff --git a/conf/orange.conf b/conf/orange.conf.example old mode 100755 new mode 100644 similarity index 100% rename from conf/orange.conf rename to conf/orange.conf.example From 1f8e1ff0bd9715af37724cb0f200641ddd186135 Mon Sep 17 00:00:00 2001 From: "yang.zhenzhen" Date: Thu, 9 Mar 2017 14:28:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?1.=20start.sh=20=E5=81=9A=E4=B8=8B=E5=88=A4?= =?UTF-8?q?=E6=96=AD=202.=20makefile=20=E6=89=93=E5=8D=B0=E7=94=9F?= =?UTF-8?q?=E6=88=90=E4=BA=86=E9=82=A3=E4=B8=AA=E9=85=8D=E7=BD=AE=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E7=9A=84=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 5 ++--- start.sh | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index adbc0cdf..9af18794 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,8 @@ ORANGE_BIN ?= /usr/local/bin/orange .PHONY: test install show init-config: - @cp conf/nginx.conf.example conf/nginx.conf - @cp conf/orange.conf.example conf/orange.conf - + @ test -f conf/nginx.conf || (cp conf/nginx.conf.example conf/nginx.conf && echo "copy nginx.conf") + @ test -f conf/orange.conf || (cp conf/orange.conf.example conf/orange.conf && echo "copy orange.conf") test: @echo "to be continued..." diff --git a/start.sh b/start.sh index cd69d67d..b5a5617e 100644 --- a/start.sh +++ b/start.sh @@ -8,6 +8,11 @@ then pid=`cat $current_path/logs/nginx.pid` fi +if [ ! -f ./conf/nginx.conf ] || [ ! -f ./conf/orange.conf ] +then + make init-config +fi + if [ "$pid" = "" ] then echo "start orange.." @@ -19,4 +24,4 @@ else fi mkdir -p logs -nginx -p `pwd` -c ./conf/nginx.conf \ No newline at end of file +nginx -p `pwd` -c ./conf/nginx.conf From 5413c94ff7a330ba6c1ccbdd6c1e2ad9d74bd80a Mon Sep 17 00:00:00 2001 From: "yang.zhenzhen" Date: Thu, 9 Mar 2017 14:31:31 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E5=BF=BD=E7=95=A5=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E8=B7=9F=E8=B8=AA=E7=9A=84=E4=B8=80=E4=BA=9B=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index a48492ef..d4ae6fdf 100644 --- a/.gitignore +++ b/.gitignore @@ -84,3 +84,6 @@ Thumbs.db /conf/nginx.conf /conf/orange.conf +*.bt +*.svg +*.cbt