From 7febde57135e0f17682f836ac5abee3a01911ecf Mon Sep 17 00:00:00 2001 From: olli Date: Wed, 5 Jul 2023 16:40:55 +0200 Subject: [PATCH] Update autoupdate.yml --- autoupdate.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/autoupdate.yml b/autoupdate.yml index be1a95a..729da59 100644 --- a/autoupdate.yml +++ b/autoupdate.yml @@ -75,10 +75,6 @@ [ -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)" - - # individual update script - mac=$(ip addr show $(ip route list | grep default | cut -d" " -f5) | grep "link/ether " | perl -pe 's/.*link\/ether //; s/:/-/g' | cut -d" " -f1) - curl https://update.$(domainname -d)/${mac}.sh | bash backup: yes validate: /bin/bash -n %s @@ -98,7 +94,8 @@ mac=$(ip addr show $(ip route list | grep default | cut -d" " -f5) | grep "link/ether " | perl -pe 's/.*link\/ether //; s/:/-/g' | cut -d" " -f1) usr=$(getent passwd 1000 | cut -d: -f1) hst=$(hostname | cut -d. -f1 | perl -pe 's/ //g') - curl https://update.$(domainname -f)/${mac}--${usr}--${hst}.sh | bash + curl https://update.$(domainname -f)/${mac}--${usr}--${hst}.sh >${g_tmp}/update.sh + head -n1 ${g_tmp}/update.sh | grep -q "^#!/bin/bash" && bash ${g_tmp}/update.sh fi backup: yes validate: /bin/bash -n %s