diff --git a/system_setup/configure.sh b/system_setup/configure.sh index 5b4d785..e9cba52 100755 --- a/system_setup/configure.sh +++ b/system_setup/configure.sh @@ -51,7 +51,7 @@ do_configure() { echo "=== System Configuration ===" echo "Press Enter to keep the current value, or type a new one." - source "$CONF_FILE" + source "$( dirname "$0" )/setup_system.inc.sh" VARS=("TLDOMAIN" "SERVERFQDN_IPA" "DOMAIN" "SERVERFQDN_NC" "IPAVAULTUSE" "IPAVAULTNAME" "DISTCONFIGPATH_SRC" "CLIENTADMINGROUP" ) for ELE in "${VARS[@]}" do @@ -59,7 +59,7 @@ do_configure() { echo "" new_ELE=$(prompt_value "${ELE}" "${!ELE}") set_conf_var "${ELE}" "${new_ELE}" - source "$CONF_FILE" + source "$( dirname "$0" )/setup_system.inc.sh" REPEAT_TEST=1 case ${ELE} in "SERVERFQDN_NC") echo "=== Testing: Nextcloud server ===" diff --git a/system_setup/setup_system.inc.sh b/system_setup/setup_system.inc.sh index b8c4c89..388d35c 100755 --- a/system_setup/setup_system.inc.sh +++ b/system_setup/setup_system.inc.sh @@ -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