[Groonga-commit] groonga/gcs [master] Use xip.io instead of editing /etc/hosts

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 25日 (水) 14:58:49 JST


Yoji SHIDARA	2012-07-25 14:58:49 +0900 (Wed, 25 Jul 2012)

  New Revision: f614b643fb7be5998236817a6fa4512dc052fffb
  https://github.com/groonga/gcs/commit/f614b643fb7be5998236817a6fa4512dc052fffb

  Log:
    Use xip.io instead of editing /etc/hosts

  Removed files:
    bin/gcs-register-hosts
  Modified files:
    bin/gcs-import-examples

  Modified: bin/gcs-import-examples (+3 -27)
===================================================================
--- bin/gcs-import-examples    2012-07-20 09:51:20 +0900 (c780755)
+++ bin/gcs-import-examples    2012-07-25 14:58:49 +0900 (6cb325d)
@@ -13,33 +13,9 @@ This script setup an example domain and import data into the domain.
 
 EOT
 
-echo "Checking prerequsites..."
+echo "Checking prerequisites..."
 echo
 
-printf "* Host entries for endpoints..."
-
-ping -c 1 doc-example-00000000000000000000000000.localhost 1> /dev/null 2>&1
-doc_ping_status=$?
-ping -c 1 search-example-00000000000000000000000000.localhost 1> /dev/null 2>&1
-search_ping_status=$?
-
-if [ $doc_ping_status -eq 0 -a $search_ping_status -eq 0 ]
-then
-  echo " "$GREEN"OK"$RESET
-else
-  echo " "$RED"not configured"$RESET
-
-  printf $YELLOW
-  cat <<EOT
-
-You need to direct 'doc-example-00000000000000000000000000.localhost' and 'search-example-00000000000000000000000000.localhost' to localhost before trying this example. The following command will make these entries on /etc/hosts:
-
-  $ sudo gcs-register-hosts example
-
-EOT
-  printf $RESET
-fi
-
 printf "* gcs running..."
 curl --silent "http://localhost:7575" > /dev/null
 if [ $? -eq 0 ]
@@ -101,7 +77,7 @@ do
     fi
 done
 
-curl -X POST --upload-file $sdf_path --header "Content-Type: application/json" http://doc-example-00000000000000000000000000.localhost:7575/2011-02-01/documents/batch
+curl -X POST --upload-file $sdf_path --header "Content-Type: application/json" http://doc-example-00000000000000000000000000.127.0.0.1.xip.io:7575/2011-02-01/documents/batch
 echo
 
 echo
@@ -111,7 +87,7 @@ cat <<EOT
 
 Now you can try searching by
 
-$ curl "http://search-example-00000000000000000000000000.localhost:7575/2011-02-01/search?q=Tokyo"
+$ curl "http://search-example-00000000000000000000000000.127.0.0.1.xip.io:7575/2011-02-01/search?q=Tokyo"
 
 or, open
 http://localhost:7575

  Deleted: bin/gcs-register-hosts (+0 -20) 100755
===================================================================
--- bin/gcs-register-hosts    2012-07-20 09:51:20 +0900 (254ca7f)
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-if [ $# -eq 0 ]
-then
-  echo "Usage: $0 [domain-name] ..."
-  echo "Register host entries for the domain [domain-name] to /etc/hosts"
-else
-  if [ -w /etc/hosts ]
-  then
-    for domain_name in "$@"
-    do
-      echo "Registering entries for '$domain_name' to /etc/hosts"
-      echo "127.0.0.1 doc-$domain_name-00000000000000000000000000.localhost" >> /etc/hosts
-      echo "127.0.0.1 search-$domain_name-00000000000000000000000000.localhost"  >> /etc/hosts
-    done
-  else
-    echo "You don't have write access to /etc/hosts."
-    echo "Try 'sudo $0 $@'"
-  fi
-fi
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
다운로드 



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