Update tools.func

This commit is contained in:
CanbiZ 2025-04-14 14:00:09 +02:00
parent 7c82a38898
commit 509b885dc8

View File

@ -715,19 +715,19 @@ EOF
systemctl daemon-reexec systemctl daemon-reexec
systemctl daemon-reload systemctl daemon-reload
systemctl enable --now update-local-ip.timer systemctl enable -q --now update-local-ip.timer
msg_ok "Setup LOCAL_IP helper in $BASE_DIR with systemd integration" msg_ok "Setup LOCAL_IP helper in $BASE_DIR with systemd integration"
} }
import_local_ip() { import_local_ip() {
setup_local_ip_helper
local IP_FILE="/run/local-ip.env" local IP_FILE="/run/local-ip.env"
if [[ -f "$IP_FILE" ]]; then if [[ -f "$IP_FILE" ]]; then
# shellcheck disable=SC1090
source "$IP_FILE" source "$IP_FILE"
fi fi
if [[ -z "$LOCAL_IP" ]]; then if [[ -z "${LOCAL_IP:-}" ]]; then
LOCAL_IP="$(ip route get 1 | awk '{print $7; exit}' 2>/dev/null)" LOCAL_IP="$(ip route get 1 | awk '{print $7; exit}' 2>/dev/null)"
if [[ -z "$LOCAL_IP" ]]; then if [[ -z "$LOCAL_IP" ]]; then
msg_error "Could not determine LOCAL_IP" msg_error "Could not determine LOCAL_IP"