Skip to content

Commit

Permalink
fix getting ip-address
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Nov 8, 2023
1 parent ebac4c9 commit 43ad776
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Containers/apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ RUN set -ex; \
ca-certificates \
openssl \
bind-tools \
netcat-openbsd; \
netcat-openbsd \
grep; \
\
sed -i \
-e '/^Listen /d' \
Expand Down
2 changes: 1 addition & 1 deletion Containers/apache/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ while ! nc -z "$NEXTCLOUD_HOST" 9000; do
done

# Get ipv4-address of Apache
IPv4_ADDRESS="$(dig nextcloud-aio-apache A +short +search | head -1)"
IPv4_ADDRESS="$(hostname -i | grep -oP '[0-9]+\.[0-9]+.[0-9]+\.[0-9]+' | head -1)"
# Bring it in CIDR notation
# shellcheck disable=SC2001
IPv4_ADDRESS="$(echo "$IPv4_ADDRESS" | sed 's|[0-9]\+$|1/32|')"
Expand Down
3 changes: 2 additions & 1 deletion Containers/talk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ RUN set -ex; \
libusrsctp \
libwebsockets \
\
shadow; \
shadow \
grep; \
useradd --system -u 1000 eturnal; \
apk del --no-cache \
shadow; \
Expand Down
2 changes: 1 addition & 1 deletion Containers/talk/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ elif [ -z "$INTERNAL_SECRET" ]; then
fi

set -x
IPv4_ADDRESS_TALK="$(dig nextcloud-aio-talk IN A +short +search | grep '^[0-9.]\+$' | sort | head -n1)"
IPv4_ADDRESS_TALK="$(hostname -i | grep -oP '[0-9]+\.[0-9]+.[0-9]+\.[0-9]+' | head -1)"
IPv6_ADDRESS_TALK="$(dig nextcloud-aio-talk AAAA +short +search | grep '^[0-9a-f:]\+$' | sort | head -n1)"
set +x

Expand Down

0 comments on commit 43ad776

Please sign in to comment.