2023-06-15 18:47:57 +00:00
|
|
|
#!/bin/sh
|
2023-11-25 21:40:52 +00:00
|
|
|
# Ensure that we can connect to seirdy.one, and print the ipv4/ipv6 addresses used. The latter makes searching through my server logs easier.
|
|
|
|
# Return a bad exit code if we can't connect over either ipv4 or ipv6.
|
|
|
|
|
|
|
|
# no pipefail here since there are no pipes.
|
2023-06-15 18:47:57 +00:00
|
|
|
set -e -u
|
|
|
|
|
2024-04-05 21:03:13 +00:00
|
|
|
echo "running connecivity check"
|
|
|
|
|
2023-06-15 18:47:57 +00:00
|
|
|
ipv6_success=1
|
|
|
|
ipv4_success=1
|
|
|
|
|
2023-11-24 02:45:03 +00:00
|
|
|
curl_wrapper="$(dirname "$0")/curl-wrapper.sh"
|
|
|
|
|
|
|
|
"$curl_wrapper" -6 'https://seirdy.one/ip' || ipv6_success=0
|
2023-06-15 18:47:57 +00:00
|
|
|
echo
|
2023-11-24 02:45:03 +00:00
|
|
|
"$curl_wrapper" -4 'https://seirdy.one/ip' || ipv4_success=0
|
2023-06-15 18:47:57 +00:00
|
|
|
echo
|
|
|
|
|
|
|
|
if [ "$ipv6_success" = 0 ] && [ "$ipv4_success" = 0 ]; then
|
|
|
|
echo "Failed to connect"
|
|
|
|
exit 1
|
|
|
|
fi
|