#!/bin/sh -e
#
# is-alive - ping + tailscale ping

ping -4 -c 1 -w 2 "$1" >/dev/null 2>&1 || exit 1

if command -v tailscale >/dev/null 2>&1; then
  tailscale ping --timeout 2s --c 1 --until-direct=false "$1" >/dev/null 2>&1 || exit 1
fi
