We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79e4f5e commit e3f636cCopy full SHA for e3f636c
bin/v-add-firewall-rule
@@ -52,7 +52,7 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
52
get_next_fw_rule
53
validate_format 'rule'
54
is_object_new '../../data/firewall/rules' 'RULE' "$rule"
55
-if [ ! -z "$comment"]; then
+if [ ! -z "$comment" ]; then
56
validate_format 'comment'
57
fi
58
bin/v-update-firewall
@@ -51,6 +51,12 @@ if [ $? -ne 0 ]; then
51
conntrack_ftp='no'
+# Checking custom OpenSSH port
+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
59
+
60
# Creating temporary file
61
tmp=$(mktemp)
62
0 commit comments