16 lines
452 B
Bash
Executable File
16 lines
452 B
Bash
Executable File
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
source "$(dirname "$0")/utils.sh"
|
|
|
|
require_root
|
|
|
|
if command -v certbot >/dev/null 2>&1; then
|
|
echo "Certbot is already installed: $(certbot --version 2>&1)"
|
|
else
|
|
echo "Installing Certbot..."
|
|
apt-get update -y || { echo "Failed to update package list"; exit 1; }
|
|
apt-get install -y certbot python3-certbot-nginx || { echo "Failed to install Certbot"; exit 1; }
|
|
echo "Certbot installed successfully."
|
|
fi
|