| 1 | #!/bin/bash |
|---|
| 2 | ##+----------------------------------------------------------------------------- |
|---|
| 3 | ##+ Isidorus |
|---|
| 4 | ##+ (c) 2008-2010 Marc Kuester, Christoph Ludwig, Lukas Georgieff |
|---|
| 5 | ##+ |
|---|
| 6 | ##+ Isidorus is freely distributable under the LLGPL license. |
|---|
| 7 | ##+ You can find a detailed description in trunk/docs/LLGPL-LICENSE.txt and |
|---|
| 8 | ##+ trunk/docs/LGPL-LICENSE.txt. |
|---|
| 9 | ##+----------------------------------------------------------------------------- |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | ## This script can be used to invoke hunchentoot's admin interface and shut down |
|---|
| 13 | ## the server. The default ip address is set to 127.0.0.1 and can be changed via |
|---|
| 14 | ## the switch -host <ip-address>. The default url that determines the server's |
|---|
| 15 | ## callback binding is set to /admin/shutdown, but this behavior can also be |
|---|
| 16 | ## changed by using the switch -url <url-fragment>. |
|---|
| 17 | ## a sample call would be ./shutdown-isidorus.sh -host 12.34.56.78 -url /admin/shutdown |
|---|
| 18 | |
|---|
| 19 | url="/admin/shutdown"; |
|---|
| 20 | host="127.0.0.1:11008"; |
|---|
| 21 | |
|---|
| 22 | if [ $# -eq 0 ]; then |
|---|
| 23 | : |
|---|
| 24 | elif [ $# -eq 1 -a $1 = "?" ]; then |
|---|
| 25 | echo "you can pass the arguments -host <host-url> and -url </url-fragment>, if no arguments are passed the default values 127.0.0.1:11008 and /admin/shutdown are used"; |
|---|
| 26 | exit; |
|---|
| 27 | elif [ $# -eq 2 ]; then |
|---|
| 28 | if [ $1 = "-host" ]; then |
|---|
| 29 | host=$2; |
|---|
| 30 | elif [ $1 = "-url" ]; then |
|---|
| 31 | url=$2; |
|---|
| 32 | else |
|---|
| 33 | echo "only the arguments -host and -url are supported, use ? for more information"; |
|---|
| 34 | exit; |
|---|
| 35 | fi |
|---|
| 36 | elif [ $# -eq 4 ]; then |
|---|
| 37 | if [ $1 = "-host" ]; then |
|---|
| 38 | host=$2; |
|---|
| 39 | elif [ $1 = "-url" ]; then |
|---|
| 40 | url=$2; |
|---|
| 41 | else |
|---|
| 42 | echo "only the arguments -host and -url are supported, use ? for more information"; |
|---|
| 43 | exit; |
|---|
| 44 | fi |
|---|
| 45 | |
|---|
| 46 | if [ $3 = "-host" ]; then |
|---|
| 47 | host=$4; |
|---|
| 48 | elif [ $3 = "-url" ]; then |
|---|
| 49 | url=$4; |
|---|
| 50 | else |
|---|
| 51 | echo "only the arguments -host and -url are supported, use ? for more information"; |
|---|
| 52 | exit; |
|---|
| 53 | fi |
|---|
| 54 | else |
|---|
| 55 | echo "only the arguments -host and -url are supported, use ? for more information"; |
|---|
| 56 | exit; |
|---|
| 57 | fi |
|---|
| 58 | |
|---|
| 59 | curl $host$url |
|---|
| 60 | |
|---|
| 61 | |
|---|
| 62 | |
|---|