Skip to content

Commit

Permalink
Automatically enable EPEL (after prompting users)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmw committed Jul 8, 2016
1 parent 031b41a commit 44113a5
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 8 deletions.
24 changes: 20 additions & 4 deletions letsencrypt-auto-source/letsencrypt-auto
Expand Up @@ -281,6 +281,26 @@ BootstrapRpmCommon() {
exit 1
fi

if [ "$ASSUME_YES" = 1 ]; then
yes_flag="-y"
fi

if ! $SUDO $tool list *virtualenv > /dev/null 2>&1; then
echo "To use Certbot, packages from the EPEL repository need to be installed."
if [ "$ASSUME_YES" = 1 ]; then
/bin/echo -n "Enabling the EPEL repository in 3 seconds..."
sleep 1s
/bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds..."
sleep 1s
/bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 seconds..."
sleep 1s
fi
if ! $SUDO $tool install $yes_flag epel-release; then
echo "Could not enable EPEL. Aborting bootstrap!"
exit 1
fi
fi

pkgs="
gcc
dialog
Expand Down Expand Up @@ -318,10 +338,6 @@ BootstrapRpmCommon() {
"
fi

if [ "$ASSUME_YES" = 1 ]; then
yes_flag="-y"
fi

if ! $SUDO $tool install $yes_flag $pkgs; then
echo "Could not install OS dependencies. Aborting bootstrap!"
exit 1
Expand Down
24 changes: 20 additions & 4 deletions letsencrypt-auto-source/pieces/bootstrappers/rpm_common.sh
Expand Up @@ -17,6 +17,26 @@ BootstrapRpmCommon() {
exit 1
fi

if [ "$ASSUME_YES" = 1 ]; then
yes_flag="-y"
fi

if ! $SUDO $tool list *virtualenv > /dev/null 2>&1; then
echo "To use Certbot, packages from the EPEL repository need to be installed."
if [ "$ASSUME_YES" = 1 ]; then
/bin/echo -n "Enabling the EPEL repository in 3 seconds..."
sleep 1s
/bin/echo -ne "\e[0K\rEnabling the EPEL repository in 2 seconds..."
sleep 1s
/bin/echo -e "\e[0K\rEnabling the EPEL repository in 1 seconds..."
sleep 1s
fi
if ! $SUDO $tool install $yes_flag epel-release; then
echo "Could not enable EPEL. Aborting bootstrap!"
exit 1
fi
fi

pkgs="
gcc
dialog
Expand Down Expand Up @@ -54,10 +74,6 @@ BootstrapRpmCommon() {
"
fi

if [ "$ASSUME_YES" = 1 ]; then
yes_flag="-y"
fi

if ! $SUDO $tool install $yes_flag $pkgs; then
echo "Could not install OS dependencies. Aborting bootstrap!"
exit 1
Expand Down

0 comments on commit 44113a5

Please sign in to comment.