From 7410cdf9f6a70f5567f4b6a03bef74b67756d4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Sj=C3=B6gren?= Date: Mon, 20 Feb 2017 11:20:41 +0100 Subject: [PATCH] add get_docker_configuration_file_args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Sjögren --- helper_lib.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/helper_lib.sh b/helper_lib.sh index df48084..0d2df7c 100644 --- a/helper_lib.sh +++ b/helper_lib.sh @@ -77,7 +77,16 @@ get_docker_cumulative_command_line_args() { # Does not account for option default or implicit options. get_docker_effective_command_line_args() { OPTION="$1" - get_docker_cumulative_command_line_args $OPTION | tail -n1 + get_docker_cumulative_command_line_args "$OPTION" | tail -n1 +} + +get_docker_configuration_file_args() { + OPTION="$1" + FILE="$(get_docker_effective_command_line_args '--config-file' | \ + sed 's/.*=//g')" + if ! grep "$OPTION" "$FILE"; then + echo 0 + fi } get_systemd_service_file(){