No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

get-letsencrypt.sh 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/usr/bin/env bash
  2. # Install LetsEncrypt official client on UNIX/Linux using a bash script.
  3. # v1.0 - 02/27/2016
  4. # By Brielle Bruns <bruns@2mbit.com>
  5. # http://www.sosdg.org
  6. # Use like: gen-letsencrypt.sh -g
  7. #
  8. # Flags:
  9. # -g - use git to download
  10. # -t - download master tarball
  11. # Where to store the LetsEncrypt package
  12. DESTDIR="/usr/src/"
  13. ZIPURL="https://github.com/letsencrypt/letsencrypt/archive/master.zip"
  14. GITREPO="https://github.com/letsencrypt/letsencrypt"
  15. if [ $# -eq 0 ]; then
  16. echo "Command Help:"
  17. echo "-g : download using git from master repo (recommended)"
  18. echo "-z : download zip from main repo and extract"
  19. exit 0
  20. fi
  21. while getopts "gz" opt; do
  22. case $opt in
  23. g) downloadtype="git";;
  24. z) downloadtype="zip";;
  25. esac
  26. done
  27. cd ${DESTDIR}
  28. case $downloadtype in
  29. git)
  30. echo "Cloning repo into ${DESTDIR}..."
  31. git clone ${GITREPO}
  32. ;;
  33. zip)
  34. echo "Downloading ${ZIPURL} into ${DESTDIR}"
  35. curl -L -o letsencrypt-master.zip ${ZIPURL}
  36. unzip -q letsencrypt-master.zip
  37. mv letsencrypt-master letsencrypt
  38. ;;
  39. esac