Created
September 15, 2025 06:41
-
-
Save jyxjjj/42330f48b3fc853c1ec0293be1ccdc35 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export API_DOMAIN | |
export API_URL | |
export PARAMS | |
/opt/homebrew/bin/curl \ | |
--interface $( | |
if ifconfig en0 2>/dev/null | grep -q 'status: active'; then | |
echo 'en0' | |
elif ifconfig en15 2>/dev/null | grep -q 'status: active'; then | |
echo 'en15' | |
else | |
echo 'en0' | |
fi | |
) \ | |
--resolve $API_DOMAIN:443:$(/opt/homebrew/bin/dig +https @223.5.5.5 $API_DOMAIN +short | tail -n1) \ | |
-fSsL -4 --connect-timeout 10 --retry-delay 1 --retry 30 \ | |
-X POST $API_URL --data-raw $PARAMS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment