/ bootstrap / venv.sh
venv.sh
 1  #!/bin/sh -e
 2  #
 3  # Installs and updates letencrypt virtualenv
 4  #
 5  # USAGE: source ./dev/venv.sh
 6  
 7  
 8  XDG_DATA_HOME=${XDG_DATA_HOME:-~/.local/share}
 9  VENV_NAME="letsencrypt"
10  VENV_PATH=${VENV_PATH:-"$XDG_DATA_HOME/$VENV_NAME"}
11  
12  # virtualenv call is not idempotent: it overwrites pip upgraded in
13  # later steps, causing "ImportError: cannot import name unpack_url"
14  if [ ! -d $VENV_PATH ]
15  then
16    virtualenv --no-site-packages --python python2 $VENV_PATH
17  fi
18  
19  . $VENV_PATH/bin/activate
20  pip install -U setuptools
21  pip install -U pip
22  
23  pip install -U letsencrypt letsencrypt-apache # letsencrypt-nginx
24  
25  echo
26  echo "Congratulations, Let's Encrypt has been successfully installed/updated!"
27  echo
28  echo -n "Your prompt should now be prepended with ($VENV_NAME). Next "
29  echo -n "time, if the prompt is different, 'source' this script again "
30  echo -n "before running 'letsencrypt'."
31  echo
32  echo
33  echo "You can now run 'letsencrypt --help'."