Skip to content

Commit

Permalink
Improve EPEL repo
Browse files Browse the repository at this point in the history
- Improve handling of the EPEL repository. Although uncommon, some systems
  can have epel-release installed but disabled in /etc/yum.repos.d/epel.repo
- Fixes hwdsl2#210
  • Loading branch information
hwdsl2 committed Jul 5, 2018
1 parent 145f29b commit b8088d3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/clients-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ apt-get -y install strongswan xl2tpd

# CentOS & RHEL
yum -y install epel-release
yum -y install strongswan xl2tpd
yum --enablerepo=epel -y install strongswan xl2tpd

# Fedora
yum -y install strongswan xl2tpd
Expand Down
2 changes: 1 addition & 1 deletion docs/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ apt-get -y install strongswan xl2tpd

# CentOS & RHEL
yum -y install epel-release
yum -y install strongswan xl2tpd
yum --enablerepo=epel -y install strongswan xl2tpd

# Fedora
yum -y install strongswan xl2tpd
Expand Down
8 changes: 4 additions & 4 deletions extras/vpnupgrade_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ yum -y install nss-devel nspr-devel pkgconfig pam-devel \
libcap-ng-devel libselinux-devel curl-devel \
flex bison gcc make || exiterr2

OPT1='--enablerepo=*server-optional*'
OPT2='--enablerepo=*releases-optional*'
REPO1='--enablerepo=*server-optional*'
REPO2='--enablerepo=*releases-optional*'
if grep -qs "release 6" /etc/redhat-release; then
yum -y remove libevent-devel
yum "$OPT1" "$OPT2" -y install libevent2-devel fipscheck-devel || exiterr2
yum "$REPO1" "$REPO2" -y install libevent2-devel fipscheck-devel || exiterr2
else
yum -y install systemd-devel || exiterr2
yum "$OPT1" "$OPT2" -y install libevent-devel fipscheck-devel || exiterr2
yum "$REPO1" "$REPO2" -y install libevent-devel fipscheck-devel || exiterr2
fi

# Compile and install Libreswan
Expand Down
18 changes: 11 additions & 7 deletions vpnsetup_centos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,18 +144,22 @@ yum -y install epel-release || yum -y install "$epel_url" || exiterr2

bigecho "Installing packages required for the VPN..."

REPO1='--enablerepo=epel'
REPO2='--enablerepo=*server-optional*'
REPO3='--enablerepo=*releases-optional*'

yum -y install nss-devel nspr-devel pkgconfig pam-devel \
libcap-ng-devel libselinux-devel curl-devel \
flex bison gcc make ppp xl2tpd || exiterr2
flex bison gcc make ppp || exiterr2

yum "$REPO1" -y install xl2tpd || exiterr2

OPT1='--enablerepo=*server-optional*'
OPT2='--enablerepo=*releases-optional*'
if grep -qs "release 6" /etc/redhat-release; then
yum -y remove libevent-devel
yum "$OPT1" "$OPT2" -y install libevent2-devel fipscheck-devel || exiterr2
yum "$REPO2" "$REPO3" -y install libevent2-devel fipscheck-devel || exiterr2
else
yum -y install systemd-devel iptables-services || exiterr2
yum "$OPT1" "$OPT2" -y install libevent-devel fipscheck-devel || exiterr2
yum "$REPO2" "$REPO3" -y install libevent-devel fipscheck-devel || exiterr2
fi

case "$(uname -r)" in
Expand All @@ -165,7 +169,7 @@ case "$(uname -r)" in
l2tp_file="xl2tpd-$L2TP_VER.tar.gz"
l2tp_url1="https://github.com/xelerance/xl2tpd/archive/v$L2TP_VER.tar.gz"
l2tp_url2="https://mirrors.kernel.org/ubuntu/pool/universe/x/xl2tpd/xl2tpd_$L2TP_VER.orig.tar.gz"
yum "$OPT1" "$OPT2" -y install libpcap-devel || exiterr2
yum "$REPO2" "$REPO3" -y install libpcap-devel || exiterr2
if ! { wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url1" || wget -t 3 -T 30 -nv -O "$l2tp_file" "$l2tp_url2"; }; then
exit 1
fi
Expand All @@ -180,7 +184,7 @@ esac

bigecho "Installing Fail2Ban to protect SSH..."

yum -y install fail2ban || exiterr2
yum "$REPO1" -y install fail2ban || exiterr2

bigecho "Compiling and installing Libreswan..."

Expand Down

0 comments on commit b8088d3

Please sign in to comment.