[Groonga-commit] droonga/droonga-http-server at 0dd65ff [master] Use service script for the installed version

Zurück zum Archiv-Index

YUKI Hiroshi null+****@clear*****
Fri Sep 26 15:18:30 JST 2014


YUKI Hiroshi	2014-09-26 15:18:30 +0900 (Fri, 26 Sep 2014)

  New Revision: 0dd65ff372d54d016dde630b3d6486b6ea5d6ca0
  https://github.com/droonga/droonga-http-server/commit/0dd65ff372d54d016dde630b3d6486b6ea5d6ca0

  Message:
    Use service script for the installed version

  Modified files:
    install.sh

  Modified: install.sh (+11 -3)
===================================================================
--- install.sh    2014-09-26 14:25:51 +0900 (14ecab8)
+++ install.sh    2014-09-26 15:18:30 +0900 (a8dcef0)
@@ -34,7 +34,7 @@
 #     # curl https://raw.githubusercontent.com/droonga/droonga-http-server/master/install.sh | HOST=xxx.xxx.xxx.xxx ENGINE_HOST=xxx.xxx.xxx.xxx bash
 
 NAME=droonga-http-server
-SCRIPT_URL=https://raw.githubusercontent.com/droonga/$NAME/master/install
+SCRIPT_URL_BASE=https://raw.githubusercontent.com/droonga/$NAME
 REPOSITORY_URL=https://github.com/droonga/$NAME.git
 USER=$NAME
 GROUP=droonga
@@ -233,6 +233,14 @@ install_master() {
   mv package.json.bak package.json
 }
 
+script_url() {
+  if [ "$VERSION" = "master" ]; then
+    echo "$SCRIPT_URL_BASE/master/$1"
+  else
+    echo "$SCRIPT_URL_BASE/v$($NAME --version)/$1"
+  fi
+}
+
 
 
 # ====================== for Debian/Ubuntu ==========================
@@ -252,7 +260,7 @@ register_service_in_debian() {
   mkdir -p $pid_dir
   chown -R $USER:$GROUP $pid_dir
 
-  curl -o /etc/init.d/$NAME $SCRIPT_URL/debian/$NAME
+  curl -o /etc/init.d/$NAME $(script_url "install/debian/$NAME")
   chmod +x /etc/init.d/$NAME
   update-rc.d $NAME defaults
 }
@@ -290,7 +298,7 @@ register_service_in_centos() {
   mkdir -p $pid_dir
   chown -R $USER:$GROUP $pid_dir
 
-  curl -o /etc/rc.d/init.d/$NAME $SCRIPT_URL/centos/$NAME
+  curl -o /etc/rc.d/init.d/$NAME $(script_url "install/centos/$NAME")
   chmod +x /etc/rc.d/init.d/$NAME
   /sbin/chkconfig --add $NAME
 }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index