From 823c6a90565c4ea033ac2ce5f5c943bcb957f2f6 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 23 Oct 2025 10:15:02 +0200 Subject: [PATCH] fix: auto-install libnss3-tools if certutil is missing - Checks for certutil command before use - Automatically installs libnss3-tools package if needed - Works with sudo for non-root users - Prevents 'command not found' errors --- install-ca-cert.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/install-ca-cert.sh b/install-ca-cert.sh index 9623622..b233227 100755 --- a/install-ca-cert.sh +++ b/install-ca-cert.sh @@ -26,6 +26,17 @@ else RUNNING_AS_ROOT=false fi +# Check for certutil +if ! command -v certutil &> /dev/null; then + echo "⚠ certutil not found, installing libnss3-tools..." + if [ "$RUNNING_AS_ROOT" = true ]; then + apt-get update && apt-get install -y libnss3-tools + else + $SUDO apt-get update && $SUDO apt-get install -y libnss3-tools + fi + echo "" +fi + # Step 1: Download CA certificate from UCS server echo "[1/5] Downloading CA certificate from UCS server..." scp root@${UCS_SERVER}:/etc/univention/ssl/ucsCA/CAcert.pem "$TEMP_CERT"