From e00b2cf06bacae382d9cf885164895e79fea3ecd Mon Sep 17 00:00:00 2001 From: Brielle Date: Sat, 27 Feb 2016 15:01:13 -0700 Subject: [PATCH] Script to easily install LE --- get-letsencrypt.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 get-letsencrypt.sh diff --git a/get-letsencrypt.sh b/get-letsencrypt.sh new file mode 100755 index 0000000..0a6995d --- /dev/null +++ b/get-letsencrypt.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# Install LetsEncrypt official client on UNIX/Linux using a bash script. +# v1.0 - 02/27/2016 +# By Brielle Bruns +# 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" + echo "-z : download zip from main repo and extract" + exit 0 +fi + + +while getopts "g:z:" opt; do + case $opt in + g) downloadtype="git";; + t) downloadtype="zip";; + esac +done + +cd ${DESTDIR} + +case $downloadtype in + git) + git clone ${GITREPO} + ;; + tar) + curl -o letsencrypt.zip ${ZIPURL} + unzip letsencrypt.zip + ;; +esac \ No newline at end of file