From 1e78e45661364697a4ca6da4469f8af4d0c8b421 Mon Sep 17 00:00:00 2001 From: Fedello <31769405+pvillaverde@users.noreply.github.com> Date: Tue, 6 Jan 2026 10:33:55 +0100 Subject: [PATCH] feat: get public ip automatically Curls the Public IP if not provided with environment variable --- healthcheck.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/healthcheck.sh b/healthcheck.sh index 2d9cb21..750fc53 100755 --- a/healthcheck.sh +++ b/healthcheck.sh @@ -1,8 +1,12 @@ #!/bin/bash +if [ -z "${PUBLIC_IP}" ]; then + PUBLIC_IP="$(curl -s https://ifconfig.me/ip)" +fi + if curl https://api.steampowered.com/ISteamApps/GetServersAtAddress/v1?addr=${PUBLIC_IP} -qq | grep Space -q then exit 0 else exit 1 -fi \ No newline at end of file +fi