Skip to content

Commit

Permalink
Extract logc to detect a repository is available or not
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Sep 17, 2014
1 parent ace2a3a commit 2fcfb08
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion install.sh
Expand Up @@ -54,6 +54,10 @@ exist_command() {
type "$1" > /dev/null 2>&1
}

exist_yum_repository() {
yum "$1" | grep --quiet epel
}

exist_user() {
id "$1" > /dev/null 2>&1
}
Expand Down Expand Up @@ -238,7 +242,7 @@ install_in_debian() {
}

install_in_centos() {
if ! yum repolist | grep --quiet epel; then
if ! exist_yum_repository epel; then
# epel-release is not installed, so install it.
yum -y install epel-release
# however, we should disable it by default because.
Expand Down

0 comments on commit 2fcfb08

Please sign in to comment.