From 0f9590a6bd7ce06dec592cdbbd366c495638bb98 Mon Sep 17 00:00:00 2001 From: qiaofeng1227 <76487013@qq.com> Date: Wed, 20 Sep 2023 14:44:46 +0800 Subject: [PATCH] credentials --- systemd/send_credentials.sh | 17 +++++------------ systemd/test/install.sh | 11 +++++++++++ systemd/websoft9.service | 4 ++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/systemd/send_credentials.sh b/systemd/send_credentials.sh index e804f9a8..a2bfdadf 100644 --- a/systemd/send_credentials.sh +++ b/systemd/send_credentials.sh @@ -4,16 +4,9 @@ set -e trap "sleep 1; continue" ERR -while ! docker cp my-container:/path/to/file websoft9-apphub:/websoft9/credentials; do - sleep 1 -done - - -while ! docker cp my-container:/path/to/file websoft9-apphub:/path/to/credentials; do - sleep 1 -done - - -while ! docker cp my-container:/path/to/file websoft9-apphub:/path/to/credentials; do - sleep 1 +while true; do + docker cp websoft9-git:/var/websoft9/credential websoft9-apphub:/websoft9/credentials + docker cp websoft9-deployment:/var/websoft9/credential websoft9-apphub:/websoft9/credentials + docker cp websoft9-proxy:/var/websoft9/credential websoft9-apphub:/websoft9/credentials + sleep 3 done \ No newline at end of file diff --git a/systemd/test/install.sh b/systemd/test/install.sh index e69de29b..0fdecc7f 100644 --- a/systemd/test/install.sh +++ b/systemd/test/install.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# Define PATH +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin +# Export PATH +export PATH +export install_path="/data/websoft9" + +cp $install_path/systemd/websoft9.service /lib/systemd/system/ +sudo systemctl daemon-reload +sudo systemctl enable websoft9.service +sudo systemctl start websoft9 \ No newline at end of file diff --git a/systemd/websoft9.service b/systemd/websoft9.service index a96b6f67..f6fdd42f 100644 --- a/systemd/websoft9.service +++ b/systemd/websoft9.service @@ -5,8 +5,8 @@ After=network.target docker [Service] KillSignal=SIGQUIT -WorkingDirectory=/data/websoft9 -ExecStart=bash send_credentials.sh +WorkingDirectory=/data/websoft9/systemd +ExecStart=-/bin/bash send_credentials.sh Restart=always Type=notify NotifyAccess=all