1
0
Fork 0
mirror of https://github.com/myvesta/vesta synced 2025-08-13 18:17:55 -07:00

Checking custom OpenSSH port

Taken from @HestiaCP
This commit is contained in:
myvesta 2021-07-27 15:27:40 +02:00 committed by GitHub
commit 54fab10b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -52,6 +52,13 @@ if [ $? -ne 0 ]; then
fi
# Checking custom OpenSSH port
# Taken from HestiaCP
sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
if [[ "$sshport" =~ ^[0-9]+$ ]] && [ "$sshport" -ne "22" ]; then
sed -i "s/PORT='22'/PORT=\'$sshport\'/" $rules
fi
# Creating temporary file
tmp=$(mktemp)