#!/bin/sh set -eu if [ "$(id -u)" -ne 0 ]; then echo "Run as root on OPNsense" >&2 exit 1 fi REPO_URL="${1:-}" PUBLIC_KEY_FILE="${2:-}" if [ -z "$REPO_URL" ] || [ -z "$PUBLIC_KEY_FILE" ]; then echo "usage: $0 https://packages.example.net/rustproxy/26.7/amd64 /path/to/rustproxy-repo.pub" >&2 exit 64 fi if [ ! -r "$PUBLIC_KEY_FILE" ]; then echo "Public key not readable: $PUBLIC_KEY_FILE" >&2 exit 1 fi install -d -m 0755 /usr/local/etc/pkg/repos /usr/local/etc/pkg/keys install -m 0444 "$PUBLIC_KEY_FILE" /usr/local/etc/pkg/keys/rustproxy-repo.pub cat > /usr/local/etc/pkg/repos/RustProxy.conf < RustProxy in OPNsense."