configure: use setup_system.inc.sh to get machineid for configuration

This commit is contained in:
Daniel unbrot Pätzold
2026-05-03 19:01:02 +02:00
parent 527a124bb1
commit 0f7dc9c043
2 changed files with 8 additions and 6 deletions
+6 -4
View File
@@ -20,14 +20,16 @@ unset _inc_arg
#Get the machine_uuid wich is needed by some userspace programs.
#As all Parameters that are bound to CPU or Mainboard, are only readable by root, we need to get the values at installtime.
#On old installations without the file, we will write it whenever possible
if [ -f $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys ]; then
export MACHINEID="$( cat $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys )"
MACHINEID_FILE="$( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys"
if [ -f ${MACHINEID_FILE} ]; then
export MACHINEID="$( cat ${MACHINEID_FILE} )"
elif [ "$EUID" -eq 0 ]; then
dmidecode -t system | grep -i 'UUID' \
| sed 's/UUID: //' | tr '[:upper:]' '[:lower:]' \
| sed 's/[^0-9a-z]*//g' | xargs | tail -c 13 \
> "$( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys"
export MACHINEID="$( cat $( dirname "${BASH_SOURCE[0]:-$0}" )/../config.d/machine_uuid.sys )"
> "${MACHINEID_FILE}"
export MACHINEID="$( cat ${MACHINEID_FILE} )"
echo "Wrote MACHINEID ${MACHINEID} to ${MACHINEID_FILE}"
fi
#Check for configure.conf - used for first setup of system