commit a348416a4db6f0dd607ebc17b753651bef3b6ea9 Author: Aleksander Cynarski Date: Sun Sep 14 08:11:34 2025 +0000 feat: install root ca diff --git a/install-root-ca.sh b/install-root-ca.sh new file mode 100644 index 0000000..f903fb6 --- /dev/null +++ b/install-root-ca.sh @@ -0,0 +1,62 @@ +#!/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" \ No newline at end of file