From e1236cb5227ee2fd13d20ef9fafbdd7e18d65e13 Mon Sep 17 00:00:00 2001 From: gyurix Date: Wed, 29 Sep 2021 11:10:33 +0000 Subject: [PATCH] Fix duplicated domain register in config file. --- scripts/check_proxy_state.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/check_proxy_state.sh b/scripts/check_proxy_state.sh index d6cb63a..08d10f7 100755 --- a/scripts/check_proxy_state.sh +++ b/scripts/check_proxy_state.sh @@ -50,7 +50,10 @@ do_proxy_restart() { done # in case of new proxy configuration generated needed to copy the domain name to the configs file.then remove new_config flag. if [[ -f $PROXY_CONFIG_DIR/new_config ]] ; then - cat $PROXY_CONFIG_DIR/new_config >> $PROXY_CONFIG_DIR/config; + if ! grep $DOMAIN $PROXY_CONFIG_DIR/new_config ; then + cat $PROXY_CONFIG_DIR/new_config >> $PROXY_CONFIG_DIR/config; + fi + rm $PROXY_CONFIG_DIR/new_config; fi }