2015-12-04 09:32:24 -05:00
|
|
|
#!/bin/bash -x
|
2017-09-07 20:54:40 -04:00
|
|
|
set -eo pipefail
|
2015-12-04 09:32:24 -05:00
|
|
|
|
2020-12-22 13:24:20 -05:00
|
|
|
# $PUBLIC_IP $PRIVATE_IP $PUBLIC_HOSTNAME are dynamically set at execution
|
2015-12-04 17:35:57 -05:00
|
|
|
|
|
|
|
|
# with curl, instance metadata available from EC2 metadata service:
|
|
|
|
|
#public_host=$(curl -s http://169.254.169.254/2014-11-05/meta-data/public-hostname)
|
|
|
|
|
#public_ip=$(curl -s http://169.254.169.254/2014-11-05/meta-data/public-ipv4)
|
|
|
|
|
#private_ip=$(curl -s http://169.254.169.254/2014-11-05/meta-data/local-ipv4)
|
2015-12-04 09:32:24 -05:00
|
|
|
|
2016-12-23 02:07:00 -05:00
|
|
|
cd letsencrypt
|
2019-04-30 13:45:03 -04:00
|
|
|
LE_AUTO_DIR="/usr/local/bin"
|
|
|
|
|
LE_AUTO_PATH="$LE_AUTO_DIR/letsencrypt-auto"
|
|
|
|
|
sudo cp letsencrypt-auto-source/letsencrypt-auto "$LE_AUTO_PATH"
|
|
|
|
|
sudo chown root "$LE_AUTO_PATH"
|
|
|
|
|
sudo chmod 0755 "$LE_AUTO_PATH"
|
|
|
|
|
export PATH="$LE_AUTO_DIR:$PATH"
|
|
|
|
|
|
2020-12-07 18:18:00 -05:00
|
|
|
# Since certbot-auto is deprecated, we expect certbot-auto to error and
|
|
|
|
|
# refuse to install Certbot.
|
|
|
|
|
set +o pipefail
|
|
|
|
|
if ! letsencrypt-auto --debug --version | grep "Certbot cannot be installed."; then
|
|
|
|
|
echo "letsencrypt-auto didn't report being uninstallable."
|
2019-04-10 21:24:32 -04:00
|
|
|
exit 1
|
|
|
|
|
fi
|
2020-12-07 18:18:00 -05:00
|
|
|
if [ ${PIPESTATUS[0]} != 1 ]; then
|
|
|
|
|
echo "letsencrypt-auto didn't exit with status 1 as expected"
|
2019-04-30 13:45:03 -04:00
|
|
|
exit 1
|
|
|
|
|
fi
|