Skip to content

Commit e3f636c

Browse files
committed
Fixes from Neilpang
1 parent 79e4f5e commit e3f636c

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

bin/v-add-firewall-rule

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ is_system_enabled "$FIREWALL_SYSTEM" 'FIREWALL_SYSTEM'
5252
get_next_fw_rule
5353
validate_format 'rule'
5454
is_object_new '../../data/firewall/rules' 'RULE' "$rule"
55-
if [ ! -z "$comment"]; then
55+
if [ ! -z "$comment" ]; then
5656
validate_format 'comment'
5757
fi
5858

bin/v-update-firewall

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ if [ $? -ne 0 ]; then
5151
conntrack_ftp='no'
5252
fi
5353

54+
# Checking custom OpenSSH port
55+
sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
56+
if [[ "$sshport" =~ ^[0-9]+$ ]] && [ "$sshport" -ne "22" ]; then
57+
sed -i "s/PORT='22'/PORT=\'$sshport\'/" $rules
58+
fi
59+
5460
# Creating temporary file
5561
tmp=$(mktemp)
5662

0 commit comments

Comments
 (0)