Fix IP address detection in installation summary for cross-distribution compatibility
- Replace hostname -I with ip addr parsing in show_installation_summary - hostname -I not available on all distributions
This commit is contained in:
2
setup.sh
2
setup.sh
@@ -494,7 +494,7 @@ run_installation() {
|
|||||||
# Installation summary
|
# Installation summary
|
||||||
show_installation_summary() {
|
show_installation_summary() {
|
||||||
local ip_address
|
local ip_address
|
||||||
ip_address=$(hostname -I | awk '{print $1}')
|
ip_address=$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | head -1 | awk '{print $2}' | cut -d/ -f1)
|
||||||
local user_home
|
local user_home
|
||||||
if [[ -n "${SUDO_USER:-}" ]]; then
|
if [[ -n "${SUDO_USER:-}" ]]; then
|
||||||
user_home=$(eval echo "~${SUDO_USER}")
|
user_home=$(eval echo "~${SUDO_USER}")
|
||||||
|
|||||||
Reference in New Issue
Block a user