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
This commit is contained in:
@@ -26,6 +26,17 @@ else
|
|||||||
RUNNING_AS_ROOT=false
|
RUNNING_AS_ROOT=false
|
||||||
fi
|
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
|
# Step 1: Download CA certificate from UCS server
|
||||||
echo "[1/5] Downloading 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"
|
scp root@${UCS_SERVER}:/etc/univention/ssl/ucsCA/CAcert.pem "$TEMP_CERT"
|
||||||
|
|||||||
Reference in New Issue
Block a user