null+****@clear*****
null+****@clear*****
2012年 3月 30日 (金) 17:51:04 JST
Kouhei Sutou 2012-03-30 17:51:04 +0900 (Fri, 30 Mar 2012)
New Revision: e7363305eacd8635c2b1ade80da646b230612c7c
Merged 0f086ce: Merge remote-tracking branch 'v2.0.0-package-fix/v2.0.0-package-fix'
Log:
redhat: extract command execution code
Modified files:
data/init.d/redhat/groonga
Modified: data/init.d/redhat/groonga (+9 -5)
===================================================================
--- data/init.d/redhat/groonga 2012-03-30 17:50:06 +0900 (f1d4739)
+++ data/init.d/redhat/groonga 2012-03-30 17:51:04 +0900 (1518dae)
@@ -106,6 +106,14 @@ fi
RETVAL=0
+send_command() {
+ command=$1
+ if [ "${PROTOCOL}" = "http" ]; then
+ $curl "http://${ADDRESS}:${PORT}/d/${command}"
+ else
+ $groonga --port $PORT -c $ADDRESS ${command}
+ fi
+}
start() {
echo -n "Starting $name: "
@@ -131,11 +139,7 @@ restart() {
}
status() {
- if [ "${PROTOCOL}" = "http" ]; then
- $curl "http://${ADDRESS}:${PORT}/d/status"
- else
- $groonga --port $PORT -c $ADDRESS status
- fi
+ send_command status
}
case "$1" in