From fbaff7b12e430d4305df20439ddf317062d7ac55 Mon Sep 17 00:00:00 2001 From: Noah Slater Date: Mon, 2 Mar 2009 14:50:15 +0000 Subject: [PATCH] added -C option to couchdb script, thanks Eric Casteleijn git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@749321 13f79535-47bb-0310-9956-ffa450edef68 --- THANKS | 1 + bin/couchdb.tpl.in | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/THANKS b/THANKS index a9b66ba9116..6f89326238a 100644 --- a/THANKS +++ b/THANKS @@ -26,5 +26,6 @@ Some of these people are: * Brian Palmer * Jason Davies * Maximillian Dornseif + * Eric Casteleijn For a list of authors see the `AUTHORS` file. diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in index 4959654afc5..709912c72d2 100644 --- a/bin/couchdb.tpl.in +++ b/bin/couchdb.tpl.in @@ -20,6 +20,7 @@ BACKGROUND_BOOLEAN=false KILL_BOOLEAN=false SHUTDOWN_BOOLEAN=false RECURSED_BOOLEAN=false +RESET_CONFIG_BOOLEAN=true RESPAWN_TIMEOUT=0 @@ -70,6 +71,7 @@ Options: -h display a short help message and exit -V display version information and exit -c FILE use configuration FILE (chainable, resets system default) + -C FILE use configuration FILE (chainable, does not reset system default) -i use the interactive Erlang shell -b spawn as a background process -p FILE set the background PID FILE (overrides system default) @@ -168,7 +170,11 @@ start_couchdb () { interactive_option="+Bd -noinput" fi if test -n "$INI_FILES"; then - ini_files="$INI_FILES" + if test "$RESET_CONFIG_BOOLEAN" = "true"; then + ini_files="$INI_FILES" + else + ini_files="$DEFAULT_INI_FILE $INI_FILES" + fi else ini_files="$DEFAULT_INI_FILE $LOCAL_INI_FILE" fi @@ -258,7 +264,7 @@ stop_couchdb () { parse_script_option_list () { set +e - options=`getopt hVc:ibp:r:Ro:e:skd $@` + options=`getopt hVc:C:ibp:r:Ro:e:skd $@` if test ! $? -eq 0; then display_error fi @@ -269,6 +275,7 @@ parse_script_option_list () { -h) shift; display_help; exit $SCRIPT_OK;; -V) shift; display_version; exit $SCRIPT_OK;; -c) shift; INI_FILES="$INI_FILES $1"; shift;; + -C) shift; RESET_CONFIG_BOOLEAN=false; INI_FILES="$INI_FILES $1"; shift;; -i) shift; INTERACTIVE_BOOLEAN=true;; -b) shift; BACKGROUND_BOOLEAN=true;; -r) shift; RESPAWN_TIMEOUT=$1; shift;;