[Dev] Replace --stop option with --once
This commit is contained in:
parent
30d6b61e52
commit
77ca0cfc56
|
@ -87,8 +87,8 @@ Mandatory argumentes for long options are mandatory for short options too.
|
||||||
-d, --daemon run processing loop in background
|
-d, --daemon run processing loop in background
|
||||||
-e, --errs=<errors_file> name of errors file, default to
|
-e, --errs=<errors_file> name of errors file, default to
|
||||||
${DEFAULT_ERRORS_FILE}
|
${DEFAULT_ERRORS_FILE}
|
||||||
|
-o, --once stop listening after first request process
|
||||||
-q, --quiet set level verbosity to WARN, default to INFO
|
-q, --quiet set level verbosity to WARN, default to INFO
|
||||||
-s, --stop stop listening after first request process
|
|
||||||
-t, --test just test config file and do not run start loop
|
-t, --test just test config file and do not run start loop
|
||||||
-v, --verbose set level verbosity to DEBUG, default to INFO
|
-v, --verbose set level verbosity to DEBUG, default to INFO
|
||||||
|
|
||||||
|
@ -260,8 +260,8 @@ main() (
|
||||||
verbosity_option=""
|
verbosity_option=""
|
||||||
verbosity_level="${DEFAULT_VERBOSITY_LEVEL}"
|
verbosity_level="${DEFAULT_VERBOSITY_LEVEL}"
|
||||||
if ! args="$(getopt --name "${PROGRAM_NAME}" \
|
if ! args="$(getopt --name "${PROGRAM_NAME}" \
|
||||||
--options c:de:hqstv \
|
--options c:de:hoqtv \
|
||||||
--longoptions conf:,daemon,errs:,help,quiet,stop,test,verbose \
|
--longoptions conf:,daemon,errs:,help,once,quiet,test,verbose \
|
||||||
-- "$@")"; then
|
-- "$@")"; then
|
||||||
usage
|
usage
|
||||||
fail "Bad arguments."
|
fail "Bad arguments."
|
||||||
|
@ -286,6 +286,10 @@ main() (
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
-o | --once)
|
||||||
|
keep_open="false"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-q | --quiet)
|
-q | --quiet)
|
||||||
if [ "${verbosity_option}" ]; then
|
if [ "${verbosity_option}" ]; then
|
||||||
usage
|
usage
|
||||||
|
@ -295,10 +299,6 @@ main() (
|
||||||
((verbosity_level -= 10))
|
((verbosity_level -= 10))
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-s | --stop)
|
|
||||||
keep_open="false"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-t | --test)
|
-t | --test)
|
||||||
testing="true"
|
testing="true"
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -81,8 +81,8 @@ Mandatory argumentes for long options are mandatory for short options too.
|
||||||
-d, --daemon run processing loop in background
|
-d, --daemon run processing loop in background
|
||||||
-e, --errs=<errors_file> name of errors file, default to
|
-e, --errs=<errors_file> name of errors file, default to
|
||||||
${DEFAULT_ERRORS_FILE}
|
${DEFAULT_ERRORS_FILE}
|
||||||
|
-o, --once stop listening after first request process
|
||||||
-q, --quiet set level verbosity to WARN, default to INFO
|
-q, --quiet set level verbosity to WARN, default to INFO
|
||||||
-s, --stop stop listening after first request process
|
|
||||||
-t, --test just test config file and do not run start loop
|
-t, --test just test config file and do not run start loop
|
||||||
-v, --verbose set level verbosity to DEBUG, default to INFO
|
-v, --verbose set level verbosity to DEBUG, default to INFO
|
||||||
|
|
||||||
|
@ -317,8 +317,8 @@ main() (
|
||||||
verbosity_option=""
|
verbosity_option=""
|
||||||
verbosity_level="${DEFAULT_VERBOSITY_LEVEL}"
|
verbosity_level="${DEFAULT_VERBOSITY_LEVEL}"
|
||||||
if ! args="$(getopt --name "${PROGRAM_NAME}" \
|
if ! args="$(getopt --name "${PROGRAM_NAME}" \
|
||||||
--options c:de:hqstv \
|
--options c:de:hoqtv \
|
||||||
--longoptions conf:,daemon,errs:,help,quiet,stop,test,verbose \
|
--longoptions conf:,daemon,errs:,help,once,quiet,test,verbose \
|
||||||
-- "$@")"; then
|
-- "$@")"; then
|
||||||
usage
|
usage
|
||||||
fail "Bad arguments."
|
fail "Bad arguments."
|
||||||
|
@ -343,6 +343,10 @@ main() (
|
||||||
usage
|
usage
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
-o | --once)
|
||||||
|
keep_open="false"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
-q | --quiet)
|
-q | --quiet)
|
||||||
if [ "${verbosity_option}" ]; then
|
if [ "${verbosity_option}" ]; then
|
||||||
usage
|
usage
|
||||||
|
@ -352,10 +356,6 @@ main() (
|
||||||
((verbosity_level -= 10))
|
((verbosity_level -= 10))
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-s | --stop)
|
|
||||||
keep_open="false"
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
-t | --test)
|
-t | --test)
|
||||||
testing="true"
|
testing="true"
|
||||||
shift
|
shift
|
||||||
|
|
|
@ -43,7 +43,7 @@ send_request() (
|
||||||
request="$1"
|
request="$1"
|
||||||
|
|
||||||
"${deployer_bin}" --conf="${conf_file}" --errs="${errs_file}" \
|
"${deployer_bin}" --conf="${conf_file}" --errs="${errs_file}" \
|
||||||
--daemon --stop --verbose || return $?
|
--daemon --once --verbose || return $?
|
||||||
(
|
(
|
||||||
inotifywait --event create --quiet --quiet "${response_sock_dir}"
|
inotifywait --event create --quiet --quiet "${response_sock_dir}"
|
||||||
echo "${request}" | ncat --unixsock "${deployer_sock}"
|
echo "${request}" | ncat --unixsock "${deployer_sock}"
|
||||||
|
|
|
@ -46,7 +46,7 @@ send_request() (
|
||||||
|
|
||||||
ncat --listen --unixsock "${deployer_sock}" &
|
ncat --listen --unixsock "${deployer_sock}" &
|
||||||
"${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \
|
"${runner_bin}" --conf="${conf_file}" --errs="${errs_file}" \
|
||||||
--daemon --stop --verbose
|
--daemon --once --verbose
|
||||||
code=$?
|
code=$?
|
||||||
if [ "${code}" -ne 0 ]; then
|
if [ "${code}" -ne 0 ]; then
|
||||||
echo "fail" | ncat --unixsock "${deployer_sock}"
|
echo "fail" | ncat --unixsock "${deployer_sock}"
|
||||||
|
|
Loading…
Reference in New Issue