From 62ab1fe69285902aa91743004ddd9cb7536323a6 Mon Sep 17 00:00:00 2001 From: seokhongkim Date: Mon, 24 Jul 2023 11:46:15 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20newline=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/.ebextensions/02-set-filebeat.config | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/.ebextensions/02-set-filebeat.config b/backend/.ebextensions/02-set-filebeat.config index 19751215c..f4a4192f7 100644 --- a/backend/.ebextensions/02-set-filebeat.config +++ b/backend/.ebextensions/02-set-filebeat.config @@ -2,15 +2,15 @@ "files": { "/tmp/make_filebeat_yml.sh": { "mode": "000755", - "content": "#!/bin/bash\nPASSWORD=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PASSWORD)\nHOST=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_HOST)\nPORT=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_PORT)\nUSER=$(sudo /opt/elasticbeanstalk/bin/get-config environment -k ELASTICSEARCH_USER)\ncat > /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat.yml < /home/ec2-user/filebeat-7.14.1-linux-x86_64/filebeat.yml < filebeat.log 2>&1 &\ndisown\necho \"Filebeat restarted\"" + "content": "#!/bin/bash\n\nPID=$(ps -ef | grep ./filebeat | grep -v grep | awk '{print $2}')\n\nif [[ -n \"$PID\" ]]; then\n echo \"Filebeat PID : $PID\"\n sudo kill -9 $PID\nelse\n echo \"Filebeat is not running.\"\nfi\n\necho \"Restarting Filebeat\"\ncd filebeat-7.14.1-linux-x86_64 && sudo chmod 644 filebeat.yml && nohup ./filebeat -e > filebeat.log 2>&1 &\ndisown\necho \"Filebeat restarted\"\n" } }, "commands": {