#!/bin/sh # ShakerScan connection check, version 2026-11-10. # The full report plus the checks only this machine can run, each with a result scoped to what # it measured. # # Run it: curl -fsSL https://shakerscan.com/x | sh # Read it first: open https://shakerscan.com/x in a browser, or # curl -fsSL https://shakerscan.com/x | less # For scripts: curl -fsSL https://shakerscan.com/x | sh -s -- --json # Its SHA-256: https://shakerscan.com/x.sha256 # # Needs curl; uses dig when installed. It contacts only shakerscan.com, ShakerScan's probe # hostnames and ShakerScan's DNS server, changes nothing on this machine and uploads no results. # Exit status: 0 nothing found, 1 something found, 2 nothing found but a check did not run, # 3 the report could not be fetched. # # Everything is inside main, called on the last line, so a download cut short runs nothing. set -u main() { zone=probe.shakerscan.com ns=205.251.192.197 # ns-197.awsdns-24.com, an authoritative Route 53 server for the probe zone https_found='' dns_found='' skipped='' rows='' json=0 for arg in "$@"; do case "$arg" in --json) json=1 ;; *) echo "Unknown option: $arg (the only option is --json)" >&2; return 3 ;; esac done # --json: the readable output is dropped and one JSON object goes to the original stdout. [ "$json" -eq 1 ] && exec 3>&1 1>/dev/null # Colour only on a terminal; NO_COLOR (no-color.org) or TERM=dumb turns it off. if [ -t 1 ] && [ -z "${NO_COLOR:-}" ] && [ "${TERM:-dumb}" != dumb ]; then esc=$(printf '\033'); B="$esc[1m" D="$esc[2m" G="$esc[32m" R="$esc[31m" Y="$esc[33m" C="$esc[36m" N="$esc[0m" else B='' D='' G='' R='' Y='' C='' N=''; fi # say