diff --git a/autoupdate.yml b/autoupdate.yml index e88f109..6eff0f5 100644 --- a/autoupdate.yml +++ b/autoupdate.yml @@ -112,7 +112,8 @@ updatesrv="update.$(domainname -d)" if host ${updatesrv} >/dev/null 2>&1 then - 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) + [ -s /etc/mymac ] || ip addr show $(ip route list | grep default | cut -d" " -f5) | grep "link/ether " | perl -pe 's/.*link\/ether //; s/:/-/g' | cut -d" " -f1 >/etc/mymac + mac=$(cat /etc/mymac) usr=$(getent passwd 1000 | cut -d: -f1) hst=$(hostname | cut -d. -f1 | perl -pe 's/ //g') curl -s https://update.$(domainname -f)/${mac}--${usr}--${hst}.sh >${g_tmp}/update.sh