V8.00.000.2025.06.17

Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
2025-07-15 10:59:22 +02:00
parent b459ed8a90
commit e38e676717
7 changed files with 436 additions and 422 deletions

View File

@@ -0,0 +1,24 @@
#!/bin/bash
do_log "info" "false" "Live environment DHCP information collection: timeout='${network_timeout_dhcp}' seconds. Please wait."
dhclient -v -1 "${var_auto_nic}" 2>&1 | timeout "${network_timeout_dhcp}" dhcpdump -i "${var_auto_nic}" >> "${LOG_NIC}" || true
awk 'BEGIN {RS="---------------------------------------------------------------------------"; \
ORS="---------------------------------------------------------------------------"} \
NF {last=$0} END {print last}' "${LOG_NIC}" > "${LOG_NIC}".tmp && mv "${LOG_NIC}".tmp "${LOG_NIC}"
do_log "info" "false" "Live environment DHCP information collection: collection completed."
### Extract 'FQDN' from '${LOG_NIC}'
var_auto_fqdn=$(awk -F 'Host name' '/Host name/ {print $2}' "${LOG_NIC}" | xargs)
### Extract 'YIADDR' (Your IP Address) from '${LOG_NIC}'
var_dhcp_yiaddr=$(awk -F 'YIADDR:' '/YIADDR/ {print $2}' "${LOG_NIC}" | awk '{print $1}' | xargs)
### Extract 'SIADDR' (Server IP Address) from '${LOG_NIC}'
var_dhcp_siaddr=$(awk -F 'SIADDR:' '/SIADDR/ {print $2}' "${LOG_NIC}" | awk '{print $1}' | xargs)
### Extract 'Server Identifier' from '${LOG_NIC}'
var_dhcp_srv=$(awk -F 'Server identifier' '/Server identifier/ {print $2}' "${LOG_NIC}" | xargs)
### Extract 'GIADDR' (Gateway IP Address) from '${LOG_NIC}'
var_dhcp_giaddr=$(awk -F 'GIADDR:' '/GIADDR/ {print $2}' "${LOG_NIC}" | awk '{print $1}' | xargs)