diff --git a/shadowsocks-libev.sh b/shadowsocks-libev.sh index 7b221b5..6c61daa 100644 --- a/shadowsocks-libev.sh +++ b/shadowsocks-libev.sh @@ -311,13 +311,17 @@ pre_install(){ echo "Press any key to start...or press Ctrl+C to cancel" char=`get_char` #Install necessary dependencies - echo -e "[${green}Info${plain}] Adding the EPEL repository..." - [ ! -f /etc/yum.repos.d/epel.repo ] && yum install -y epel-release - [ ! "$(command -v yum-config-manager)" ] && yum install -y yum-utils - [ ! -f /etc/yum.repos.d/epel.repo ] && echo -e "${red}Error${plain} Install EPEL repository failed, please check it." && exit 1 - [ -f /etc/yum.repos.d/epel.repo ] && yum-config-manager --enable epel - echo -e "[${green}Info${plain}] Adding the EPEL repository complete..." - yum install -y unzip openssl openssl-devel gettext gcc autoconf libtool automake make asciidoc xmlto udns-devel libev-devel pcre pcre-devel git c-ares-devel + echo -e "[${green}Info${plain}] Checking the EPEL repository..." + if [ ! -f /etc/yum.repos.d/epel.repo ]; then + yum install -y -q epel-release + fi + [ ! -f /etc/yum.repos.d/epel.repo ] && echo -e "[${red}Error${plain}] Install EPEL repository failed, please check it." && exit 1 + [ ! "$(command -v yum-config-manager)" ] && yum install -y -q yum-utils + if [ x"`yum-config-manager epel | grep -w enabled | awk '{print $3}'`" != x"True" ]; then + yum-config-manager --enable epel + fi + echo -e "[${green}Info${plain}] Checking the EPEL repository complete..." + yum install -y -q unzip openssl openssl-devel gettext gcc autoconf libtool automake make asciidoc xmlto libev-devel pcre pcre-devel git c-ares-devel } download() {