diff --git a/.build.yml b/.build.yml index 18fcc2a..1cebf4d 100644 --- a/.build.yml +++ b/.build.yml @@ -28,8 +28,5 @@ tasks: cd seirdy.one export PATH=~/bin:$PATH # quick health + ip check - curl -6 --proto "=https" --proto-default https --http2 -siSL --tlsv1.3 --cert-status 'seirdy.one/ip' - echo - curl -4 --proto "=https" --proto-default https --http2 -sSL --tlsv1.3 --cert-status 'seirdy.one/ip' - echo + sh scripts/connectivity-check.sh bmake deploy-prod deploy-onion diff --git a/scripts/connectivity-check.sh b/scripts/connectivity-check.sh new file mode 100644 index 0000000..a106530 --- /dev/null +++ b/scripts/connectivity-check.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e -u + +alias curl_cmd=curl --proto "=https" --proto-default https --http2 -siSL --tlsv1.3 --cert-status + +ipv6_success=1 +ipv4_success=1 + +curl_cmd -6 'seirdy.one/ip' || ipv6_success=0 +echo +curl_cmd -4 'seirdy.one/ip' || ipv4_success=0 +echo + +if [ "$ipv6_success" = 0 ] && [ "$ipv4_success" = 0 ]; then + echo "Failed to connect" + exit 1 +fi