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:
parent
083954af41
commit
54fab10b52
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue