From 3a6232db7afcbc7d21596187d5bba12cba8ca40c Mon Sep 17 00:00:00 2001 From: Khiet Tam Nguyen Date: Mon, 23 Dec 2024 00:15:13 +1100 Subject: [PATCH 1/2] fix: install inetutils on Arch Linux This provides the `hostname` command used in the install.sh script, which is not available by default on Arch Linux. Some relevant resources: - https://bbs.archlinux.org/viewtopic.php?id=125308 - https://archlinux.org/news/deprecation-of-net-tools/ - https://man.archlinux.org/man/hostname.1.en --- scripts/install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/install.sh b/scripts/install.sh index 3f289438f..f4cecf694 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -160,7 +160,8 @@ echo -e "1. Installing required packages (curl, wget, git, jq, openssl). " case "$OS_TYPE" in arch) - pacman -Sy --noconfirm --needed curl wget git jq openssl >/dev/null || true + # inetutils provides the 'hostname' command + pacman -Sy --noconfirm --needed curl wget git jq openssl inetutils >/dev/null || true ;; alpine) sed -i '/^#.*\/community/s/^#//' /etc/apk/repositories From 51dc22988d0c9661e975ac662fc7a693063e8973 Mon Sep 17 00:00:00 2001 From: Khiet Tam Nguyen Date: Tue, 24 Dec 2024 09:11:38 +1100 Subject: [PATCH 2/2] fix: use ip in place of hostname from inetutils in arch --- scripts/install.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index f4cecf694..b5e163907 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -160,8 +160,7 @@ echo -e "1. Installing required packages (curl, wget, git, jq, openssl). " case "$OS_TYPE" in arch) - # inetutils provides the 'hostname' command - pacman -Sy --noconfirm --needed curl wget git jq openssl inetutils >/dev/null || true + pacman -Sy --noconfirm --needed curl wget git jq openssl >/dev/null || true ;; alpine) sed -i '/^#.*\/community/s/^#//' /etc/apk/repositories @@ -543,7 +542,7 @@ echo -e "You can access Coolify through your Public IP: http://$(curl -4s https: set +e DEFAULT_PRIVATE_IP=$(ip route get 1 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p') -PRIVATE_IPS=$(hostname -I) +PRIVATE_IPS=$(hostname -I 2>/dev/null || ip -o addr show scope global | awk '{print $4}' | cut -d/ -f1) set -e if [ -n "$PRIVATE_IPS" ]; then