Skip to content

Commit

Permalink
feat(脚本): 优化证书时间检查、添加centos selinux检查
Browse files Browse the repository at this point in the history
  • Loading branch information
mack-a committed May 10, 2023
1 parent 072bc15 commit 3170a4e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ echoContent() {
;;
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() {
if [[ -n $(find /etc -name "redhat-release") ]] || grep </proc/version -q -i "centos"; then
mkdir -p /etc/yum.repos.d
Expand All @@ -48,7 +57,7 @@ checkSystem() {
installType='yum -y install'
removeType='yum -y remove'
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
release="debian"
installType='apt -y install'
Expand Down Expand Up @@ -1685,9 +1694,9 @@ renewalTLS() {
modifyTime=

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
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

modifyTime=$(date +%s -d "${modifyTime}")
Expand Down Expand Up @@ -6918,7 +6927,7 @@ menu() {
cd "$HOME" || exit
echoContent red "\n=============================================================="
echoContent green "作者:mack-a"
echoContent green "当前版本:v2.8.16"
echoContent green "当前版本:v2.8.17"
echoContent green "Github:https://github.com/mack-a/v2ray-agent"
echoContent green "描述:八合一共存脚本\c"
showInstallStatus
Expand Down

0 comments on commit 3170a4e

Please sign in to comment.