fix(portforwarding): handle deletion correctly

pull/597/head
jon4hz 5 months ago
parent ba48fa8c90
commit 980d000325
No known key found for this signature in database
GPG Key ID: 4B0AFE9E7118898E

@ -761,6 +761,14 @@ sub access_modify {
$shouldDelete = 0;
}
# validate portforwarding if defined
if ($shouldDelete && defined $remotePort) {
$shouldDelete = 0 unless $line =~ m{\# REMOTEPORT=\Q$remotePort\E(\s|$)};
}
elsif ($shouldDelete && $line =~ m{\# REMOTEPORT=}) {
$shouldDelete = 0;
}
if ($shouldDelete) {
chomp $line;
$line = "# $line # $comment\n";

Loading…
Cancel
Save