-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget-letsencrypt.sh
executable file
·47 lines (39 loc) · 1.02 KB
/
get-letsencrypt.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env bash
# Install LetsEncrypt official client on UNIX/Linux using a bash script.
# v1.0 - 02/27/2016
# By Brielle Bruns <[email protected]>
# http://www.sosdg.org
# Use like: gen-letsencrypt.sh -g
#
# Flags:
# -g - use git to download
# -t - download master tarball
# Where to store the LetsEncrypt package
DESTDIR="/usr/src/"
ZIPURL="https://github.com/letsencrypt/letsencrypt/archive/master.zip"
GITREPO="https://github.com/letsencrypt/letsencrypt"
if [ $# -eq 0 ]; then
echo "Command Help:"
echo "-g : download using git from master repo (recommended)"
echo "-z : download zip from main repo and extract"
exit 0
fi
while getopts "gz" opt; do
case $opt in
g) downloadtype="git";;
z) downloadtype="zip";;
esac
done
cd ${DESTDIR}
case $downloadtype in
git)
echo "Cloning repo into ${DESTDIR}..."
git clone ${GITREPO}
;;
zip)
echo "Downloading ${ZIPURL} into ${DESTDIR}"
curl -L -o letsencrypt-master.zip ${ZIPURL}
unzip -q letsencrypt-master.zip
mv letsencrypt-master letsencrypt
;;
esac