Browse Source

removed extra comments. certbot image cleanup now always happens when uninstalling, regardless of BW image cleanup

pull/440/head
gitclonebrian 2 days ago
parent
commit
cd19f7fa91
  1. 11
      run.sh

11
run.sh

@ -91,7 +91,6 @@ function install() {
certonly --standalone --noninteractive --agree-tos --preferred-challenges http \ certonly --standalone --noninteractive --agree-tos --preferred-challenges http \
--email $EMAIL -d $DOMAIN --logs-dir /etc/letsencrypt/logs --email $EMAIL -d $DOMAIN --logs-dir /etc/letsencrypt/logs
# check if the certbot image should be removed from the system
certbotCleanup certbotCleanup
fi fi
fi fi
@ -178,7 +177,6 @@ function updateLetsEncrypt() {
-v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \ -v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
renew --logs-dir /etc/letsencrypt/logs renew --logs-dir /etc/letsencrypt/logs
# check if the certbot image should be removed from the system
certbotCleanup certbotCleanup
fi fi
} }
@ -191,7 +189,6 @@ function forceUpdateLetsEncrypt() {
-v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \ -v $OUTPUT_DIR/letsencrypt:/etc/letsencrypt/ certbot/certbot \
renew --logs-dir /etc/letsencrypt/logs --force-renew renew --logs-dir /etc/letsencrypt/logs --force-renew
# check if the certbot image should be removed from the system
certbotCleanup certbotCleanup
fi fi
} }
@ -288,10 +285,10 @@ function uninstall() {
if [ "$PURGE_ACTION" == "y" ] if [ "$PURGE_ACTION" == "y" ]
then then
dockerPrune dockerPrune
certbotCleanup
echo -e -n "${CYAN}Bitwarden uninstall complete! ${NC}" echo -e -n "${CYAN}Bitwarden uninstall complete! ${NC}"
fi fi
certbotCleanup
} }
function printEnvironment() { function printEnvironment() {
@ -322,15 +319,13 @@ function pullSetup() {
} }
function certbotCleanup() { function certbotCleanup() {
# check if the certbot image is being used by any containers # Check if the certbot image is being used by any containers
if [[ -z $(docker ps -a --filter ancestor=certbot/certbot --quiet) ]] if [[ -z $(docker ps -a --filter ancestor=certbot/certbot --quiet) ]]
then then
# prompt the user
echo -e -n "${RED}(!) The [certbot/certbot] container image used by this script is no longer associated with any containers. Would you like to purge it? (y/N): ${NC}" echo -e -n "${RED}(!) The [certbot/certbot] container image used by this script is no longer associated with any containers. Would you like to purge it? (y/N): ${NC}"
read RESPONSE read RESPONSE
RESPONSE=$(echo "$RESPONSE" | tr '[:upper:]' '[:lower:]') RESPONSE=$(echo "$RESPONSE" | tr '[:upper:]' '[:lower:]')
# remove the image if that's what the user chooses
if [[ $RESPONSE == 'y' ]] if [[ $RESPONSE == 'y' ]]
then then
docker image rm certbot/certbot docker image rm certbot/certbot

Loading…
Cancel
Save