#!/usr/bin/env sh set -e CA_URL="https://ca.para.net:9000" ROOT_URL="$CA_URL/roots.pem" TMP_FILE="$(mktemp)" echo "Downloading roots.pem from $ROOT_URL ..." curl -sSLk "$ROOT_URL" -o "$TMP_FILE" if [ ! -s "$TMP_FILE" ]; then echo "Error: roots.pem is empty or failed to download." exit 1 fi # Read /etc/os-release (source manually in POSIX shell) OS_ID="" OS_LIKE="" if [ -f /etc/os-release ]; then while IFS= read -r line; do case "$line" in ID=*) OS_ID=$(echo "$line" | cut -d= -f2 | tr -d '"') ;; ID_LIKE=*) OS_LIKE=$(echo "$line" | cut -d= -f2 | tr -d '"') ;; esac done /dev/null 2>&1; then echo "Connection successful — root CA is trusted." else echo "Connection failed — check certificate installation or network configuration." fi rm -f "$TMP_FILE"