From 29c87be593636b90c4aab854b99578863362cd8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20unbrot=20P=C3=A4tzold?= Date: Thu, 30 Apr 2026 15:06:47 +0200 Subject: [PATCH] Replace instable HOSTNM determination by file for installation. --- .gitignore | 1 + config/setup_system.conf.dist | 27 ++++++++++++++------------- system_setup/configure.sh | 3 ++- system_setup/install.sh | 6 ++---- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 656b86f..e1390fd 100644 --- a/.gitignore +++ b/.gitignore @@ -9,5 +9,6 @@ config/skel.tar.zst config/.sync_*.db config/.sync_*.db config.d/*.conf +config.d/*.sys ks_pc_prof/* ks.cfg diff --git a/config/setup_system.conf.dist b/config/setup_system.conf.dist index 613032d..8c04d4a 100644 --- a/config/setup_system.conf.dist +++ b/config/setup_system.conf.dist @@ -12,24 +12,25 @@ export INSTALLDOCS="https://gitea.dtext.online/obel1x/fedora-OEMDRV/src/branch/m export UPGRADEURL="https://gitea.dtext.online/obel1x/fedora-OEMDRV.git" export UPGRADEBRANCH="main" -#Group, that will have sudo rights on the client -export CLIENTADMINGROUP="clientadmins" - -# Method to determine Unique Hostname / FQDN of the Client. May be replaced by your needs -if [ -r /opt/sys_config/config.d/machine_uuid.sys ]; then - export HOSTNM="pc-$( cat /opt/sys_config/config.d/machine_uuid.sys )" -elif [ "$EUID" -eq 0 ]; then - export HOSTNM="pc-$( dmidecode -t system | grep -i 'UUID' | sed 's/UUID: //' | tr '[:upper:]' '[:lower:]' | sed 's/[^0-9a-z]*//g' | xargs|tail -c 13)" -else - export HOSTNM=$( hostname -s ) -fi -export FQDN=${HOSTNM}.${DOMAIN} - #Configuration Files - maybe syned with your companies settings export SYSCONFIGPATH="/opt/sys_config" export DISTCONFIGPATH="/opt/sys_config/config" export DISTCONFIGPATH_SRC="/Shared/sw_geteilt/client_settings" +#Group, that will have sudo rights on the client +export CLIENTADMINGROUP="clientadmins" + +# Method to determine Unique Hostname / FQDN of the Client. May be replaced by your needs +#Should always had been set by install.sh and should be there anyway. +#if [ ! -r ${SYSCONFIGPATH}/config.d/machine_uuid.sys ]; then +#elif [ "$EUID" -eq 0 ]; then +# export HOSTNM="pc-$( dmidecode -t system | grep -i 'UUID' | sed 's/UUID: //' | tr '[:upper:]' '[:lower:]' | sed 's/[^0-9a-z]*//g' | xargs|tail -c 13)" +#else +# export HOSTNM=$( hostname -s ) +#fi +export HOSTNM="pc-$( cat /opt/sys_config/config.d/machine_uuid.sys )" +export FQDN=${HOSTNM}.${DOMAIN} + #Additional Client-Software- Repository-Folder in Nextcloud (Shared Folder / Systemwide) export CLIENT_SOFTWARE_DST="/opt/sys_config/client_software" # Optional. If you don't have a Folder that should always be synced, leave this empty export CLIENT_SOFTWARE_SRC="/Shared/sw_geteilt/client_software" Set to the Nextcloud directory where the software should come from diff --git a/system_setup/configure.sh b/system_setup/configure.sh index 3f7080d..986021b 100755 --- a/system_setup/configure.sh +++ b/system_setup/configure.sh @@ -52,7 +52,8 @@ do_configure() { echo "" source "$CONF_FILE" - VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "IPAVAULTNAME" "CLIENT_SOFTWARE_SRC" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" ) + # Currently not possible to change "IPAVAULTNAME" becaue + VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "CLIENT_SOFTWARE_SRC" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" ) for ELE in "${VARS[@]}" do while true; do diff --git a/system_setup/install.sh b/system_setup/install.sh index e31581e..feb4072 100755 --- a/system_setup/install.sh +++ b/system_setup/install.sh @@ -499,14 +499,12 @@ cd "$MOUNT_POINT" || die "Cannot cd to $MOUNT_POINT." git clone --progress --depth 1 "$REPO_URL" . || die "git clone failed." # Write hardware UUID to a user-readable per-machine file -mkdir -p "${MOUNT_POINT}/config.d" dmidecode -t system | grep -i 'UUID' \ | sed 's/UUID: //' | tr '[:upper:]' '[:lower:]' \ | sed 's/[^0-9a-z]*//g' | xargs | tail -c 13 \ - > "${MOUNT_POINT}/config.d/machine_uuid.sys" -chmod 0444 "${MOUNT_POINT}/config.d/machine_uuid.sys" + > "./config.d/machine_uuid.sys" -chmod o=rwX . -R # to make changes to the configuration possible after install + chmod o=rwX . -R # to make changes to the configuration possible after install # ── Done ──────────────────────────────────────────────────────────────────────