Update rhel.sh

This commit is contained in:
Mr Chen 2024-06-10 03:37:12 +08:00
parent 4d1ac42057
commit 573cc3fc47
1 changed files with 2 additions and 0 deletions

View File

@ -48,6 +48,8 @@ if [ ! -d /root/.acme.sh ];then
curl https://get.acme.sh | sh
fi
yum install -y net-tools
SSH_PORT=`netstat -ntpl|grep sshd|grep -v grep | sed -n "1,1p" | awk '{print $4}' | awk -F : '{print $2}'`
if [ "$SSH_PORT" == "" ];then
SSH_PORT_LINE=`cat /etc/ssh/sshd_config | grep "Port \d*" | tail -1`