From d8dab942a7adadd2987fda215a86ed901e5fcb56 Mon Sep 17 00:00:00 2001 From: olli Date: Tue, 18 Jul 2023 15:26:07 +0200 Subject: [PATCH] autoupdate.yml aktualisiert --- autoupdate.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/autoupdate.yml b/autoupdate.yml index 1087623..c3601e6 100644 --- a/autoupdate.yml +++ b/autoupdate.yml @@ -73,9 +73,16 @@ marker: "# {mark} ANSIBLE MANAGED BLOCK" block: | # Server-Config in Git - [ -e /root/server-$(hostname -s)/$(hostname -s).sh ] && bash -x /root/server-$(hostname -s)/$(hostname -s).sh >/var/log/server-$(hostname -s)-update.log 2>&1 - g_echo_warn "$(egrep -B1 "^changed" /var/log/server-$(hostname -s)-update.log)" - g_echo_error "$(egrep -q -B1 -i '^error|^fatal' /var/log/server-$(hostname -s)-update.log && egrep -B50 '^error|^fatal' /var/log/server-$(hostname -s)-update.log)" + cd /root || exit 0 + git clone ssh://git@gitea.ds9.dedyn.io:333/olli/server-$(hostname -s).git >/dev/null 2>&1 || exit 0 + if [ -e /root/server-$(hostname -s)/$(hostname -s).sh ] + then + bash -x /root/server-$(hostname -s)/$(hostname -s).sh >/var/log/server-$(hostname -s)-update.log 2>&1 + g_echo_warn "$(egrep -B1 "^changed" /var/log/server-$(hostname -s)-update.log)" + g_echo_error "$(egrep -q -B1 -i '^error|^fatal' /var/log/server-$(hostname -s)-update.log && egrep -B50 '^error|^fatal' /var/log/server-$(hostname -s)-update.log)" + else + g_echo_warn "no server-update-script found /root/server-$(hostname -s)/$(hostname -s).sh" + fi backup: yes validate: /bin/bash -n %s