feat(脚本): 优化证书时间检查、添加centos selinux检查

pull/656/head
mack-a 2023-05-10 16:16:55 +08:00
parent 072bc15146
commit 3170a4e5fa
1 changed files with 13 additions and 4 deletions

View File

@ -32,6 +32,15 @@ echoContent() {
;; ;;
esac esac
} }
# 检查SELinux状态
checkCentosSELinux() {
if [[ -f "/etc/selinux/config" ]] && ! grep -q "SELINUX=disabled" <"/etc/selinux/config"; then
echoContent yellow "# 注意事项"
echoContent yellow "检测到SELinux已开启请手动关闭教程如下"
echoContent yellow "https://www.v2ray-agent.com/archives/1679931532764#heading-8 "
exit 0
fi
}
checkSystem() { checkSystem() {
if [[ -n $(find /etc -name "redhat-release") ]] || grep </proc/version -q -i "centos"; then if [[ -n $(find /etc -name "redhat-release") ]] || grep </proc/version -q -i "centos"; then
mkdir -p /etc/yum.repos.d mkdir -p /etc/yum.repos.d
@ -48,7 +57,7 @@ checkSystem() {
installType='yum -y install' installType='yum -y install'
removeType='yum -y remove' removeType='yum -y remove'
upgrade="yum update -y --skip-broken" upgrade="yum update -y --skip-broken"
checkCentosSELinux
elif grep </etc/issue -q -i "debian" && [[ -f "/etc/issue" ]] || grep </etc/issue -q -i "debian" && [[ -f "/proc/version" ]]; then elif grep </etc/issue -q -i "debian" && [[ -f "/etc/issue" ]] || grep </etc/issue -q -i "debian" && [[ -f "/proc/version" ]]; then
release="debian" release="debian"
installType='apt -y install' installType='apt -y install'
@ -1685,9 +1694,9 @@ renewalTLS() {
modifyTime= modifyTime=
if [[ "${installDNSACMEStatus}" == "true" ]]; then if [[ "${installDNSACMEStatus}" == "true" ]]; then
modifyTime=$(stat "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}') modifyTime=$(stat --format=%z "$HOME/.acme.sh/*.${dnsTLSDomain}_ecc/*.${dnsTLSDomain}.cer")
else else
modifyTime=$(stat "$HOME/.acme.sh/${domain}_ecc/${domain}.cer" | sed -n '7,6p' | awk '{print $2" "$3" "$4" "$5}') modifyTime=$(stat --format=%z "$HOME/.acme.sh/${domain}_ecc/${domain}.cer")
fi fi
modifyTime=$(date +%s -d "${modifyTime}") modifyTime=$(date +%s -d "${modifyTime}")
@ -6918,7 +6927,7 @@ menu() {
cd "$HOME" || exit cd "$HOME" || exit
echoContent red "\n==============================================================" echoContent red "\n=============================================================="
echoContent green "作者mack-a" echoContent green "作者mack-a"
echoContent green "当前版本v2.8.16" echoContent green "当前版本v2.8.17"
echoContent green "Githubhttps://github.com/mack-a/v2ray-agent" echoContent green "Githubhttps://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c" echoContent green "描述:八合一共存脚本\c"
showInstallStatus showInstallStatus