-
Notifications
You must be signed in to change notification settings - Fork 33
/
install.sh
executable file
·28 lines (21 loc) · 878 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
ROOT=~/.certbot-src
# Remove older versions if existing, for a simple re-install/update.
rm -rf $ROOT
# Creating the directory
mkdir -p $ROOT
# Clone certbot source.
git clone https://github.com/certbot/certbot $ROOT
# Check if python3-venv is installed, and install it otherwise.
CHECK_PACKAGES='python3-venv git'
if ! dpkg -s $CHECK_PACKAGES >/dev/null 2>&1; then
echo "The packages '$CHECK_PACKAGES' are not installed. "
echo "They will now be installed automatically with 'sudo apt-get install $CHECK_PACKAGES'."
sudo apt-get install -y $CHECK_PACKAGES
fi
# Setup virtual environment for certbot.
cd $ROOT
sudo apt-get install -y python3-dev python3-venv gcc libaugeas0 libssl-dev libffi-dev ca-certificates openssl
python3 tools/venv.py
# Link installed certbot version, so it can used everywhere.
sudo ln -s $ROOT/venv/bin/certbot /usr/local/bin/