From 5ffbfbc9d531e6b92b25ac4f379ef64295f3fa79 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 7 Mar 2018 01:50:46 +0100 Subject: [PATCH] Save client configurations in seperate directory 'client-configs'. --- build_key-pass.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build_key-pass.sh b/build_key-pass.sh index e7c7c7d..d2a10d2 100755 --- a/build_key-pass.sh +++ b/build_key-pass.sh @@ -321,7 +321,22 @@ else error "$(cat $log_file)" fi -_client_conf_file="${OPENVPN_BASE_DIR}/${NEW_KEY_NAME}.conf" +_client_conf_dir="${OPENVPN_BASE_DIR}/clien-configs" +_client_conf_file="${_client_conf_dir}/${NEW_KEY_NAME}.conf" + +echononl " Create client config dir '$_client_conf_dir'.." +if [[ ! -d "$_client_conf_dir" ]]; then + mkdir "$_client_conf_dir" > $log_file 2>&1 + if [[ $? -eq 0 ]]; then + echo_ok + else + echo_failed + error "$(cat $log_file)" + fi +else + echo_skipped +fi + echononl " Create sample client configuration ${_client_conf_file}.." cat << EOF > "$_client_conf_file" 2> $log_file ##############################################