Skip to content

Commit

Permalink
chore(*): fix fedora install error (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
muzi502 authored Sep 18, 2021
1 parent 01b6a9b commit 809e4f2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ deploy_compose(){
system::centos::disable_selinux
system::centos::config_repo
;;
Fedora|fedora)
system::fedora::disable_selinux
system::fedora::config_repo
;;
Ubuntu|ubuntu)
system::ubuntu::config_repo
;;
Expand Down
16 changes: 16 additions & 0 deletions library/system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ system::centos::disable_selinux(){
infolog "Disabled selinux service successfully"
}

system::fedora::disable_selinux(){
sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config
setenforce 0 || warnlog "Warning: setenforce 0 failed"
infolog "Disabled selinux service successfully"
}

system::centos::config_repo(){
infolog "Updated the yum repo file"
yum clean -q all || true
Expand All @@ -20,6 +26,16 @@ system::centos::config_repo(){
fi
}

system::fedora::config_repo(){
infolog "Updated the yum repo file"
yum clean -q all || true
cp -f ${RESOURCES_NGINX_DIR}/repos/CentOS-7-All-in-One.repo /etc/yum.repos.d/offline-resources.repo
sed -i "s#${DEFAULT_URL}#file://${RESOURCES_NGINX_DIR}#g" /etc/yum.repos.d/offline-resources.repo
if yum makecache -q > /dev/null; then
infolog "Updated the repo file successfully"
fi
}

system::debian::config_repo(){
infolog "Update the apt list file"
echo "deb [trusted=yes] file://${RESOURCES_NGINX_DIR}/debian/${ARCH} ${VERSION_CODENAME}/" \
Expand Down

0 comments on commit 809e4f2

Please sign in to comment.