[Groonga-commit] groonga/groonga [master] deb: extract command execution code

Back to archive index

null+****@clear***** null+****@clear*****
2012年 3月 30日 (金) 17:47:46 JST


Kouhei Sutou	2012-03-30 17:47:46 +0900 (Fri, 30 Mar 2012)

  New Revision: c95e784c7ca0e31f6398ba2b00887de0ec156805

  Merged 0f086ce: Merge remote-tracking branch 'v2.0.0-package-fix/v2.0.0-package-fix'

  Log:
    deb: extract command execution code

  Modified files:
    packages/debian/groonga-server.init

  Modified: packages/debian/groonga-server.init (+11 -5)
===================================================================
--- packages/debian/groonga-server.init    2012-03-30 17:46:05 +0900 (b506a4b)
+++ packages/debian/groonga-server.init    2012-03-30 17:47:46 +0900 (3e6b6f0)
@@ -102,6 +102,16 @@ fi
 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
 . /lib/lsb/init-functions
 
+send_command()
+{
+    command=$1
+    if [ "${PROTOCOL}" = "http" ]; then
+	$CURL "http://${ADDRESS}:${PORT}/d/${command}"
+    else
+        $DAEMON --port ${PORT} -c ${ADDRESS} ${command}
+    fi
+}
+
 #
 # Function that starts the daemon/service
 #
@@ -164,11 +174,7 @@ do_status() {
     if [ -z "${ADDRESS}" ]; then
 	ADDRESS="localhost"
     fi
-    if [ "${PROTOCOL}" = "http" ]; then
-	$CURL "http://${ADDRESS}:${PORT}/d/status"
-    else
-        $DAEMON --port ${PORT} -c ${ADDRESS} status
-    fi
+    send_command status
     return $?
 }
 




Groonga-commit メーリングリストの案内
Back to archive index