From 809e4f2d4e5c331b08d9f4ec4b68e0ce9064df1c Mon Sep 17 00:00:00 2001 From: Reimu Date: Sat, 18 Sep 2021 18:51:11 +0800 Subject: [PATCH] chore(*): fix fedora install error (#29) --- install.sh | 4 ++++ library/system.sh | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/install.sh b/install.sh index 2ecccc6..36f27f3 100644 --- a/install.sh +++ b/install.sh @@ -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 ;; diff --git a/library/system.sh b/library/system.sh index 7eb18e2..27fd076 100644 --- a/library/system.sh +++ b/library/system.sh @@ -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 @@ -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}/" \