Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
freedombone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Context Sensitive Group
freedombone
Commits
b6a68fed
Commit
b6a68fed
authored
8 years ago
by
Bob Mottram
Browse files
Options
Downloads
Patches
Plain Diff
Adding port ranges
parent
5d70998b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/freedombone-utils-firewall
+24
-0
24 additions, 0 deletions
src/freedombone-utils-firewall
with
24 additions
and
0 deletions
src/freedombone-utils-firewall
+
24
−
0
View file @
b6a68fed
...
...
@@ -239,6 +239,30 @@ function firewall_add {
fi
}
function
firewall_add_range
{
firewall_name
=
$(
echo
"
$1
"
|
sed
"s| |-|g"
)
firewall_port_start
=
$2
firewall_port_end
=
$3
firewall_protocol
=
"
$4
"
if
!
grep
-q
"
${
firewall_name
}
=
${
firewall_port_start
}
:
${
firewall_port_end
}
"
$FIREWALL_CONFIG
;
then
echo
"
${
firewall_name
}
=
${
firewall_port_start
}
:
${
firewall_port_end
}
"
>>
$FIREWALL_CONFIG
if
[
!
${
firewall_protocol
}
]
;
then
iptables
-A
INPUT
-p
udp
--dport
${
firewall_port_start
}
:
${
firewall_port_end
}
-j
ACCEPT
iptables
-A
INPUT
-p
tcp
--dport
${
firewall_port_start
}
:
${
firewall_port_end
}
-j
ACCEPT
else
if
[[
"
${
firewall_protocol
}
"
==
*
"udp"
*
]]
;
then
iptables
-A
INPUT
-p
udp
--dport
${
firewall_port_start
}
:
${
firewall_port_end
}
-j
ACCEPT
fi
if
[[
"
${
firewall_protocol
}
"
==
*
"tcp"
*
]]
;
then
iptables
-A
INPUT
-p
tcp
--dport
${
firewall_port_start
}
:
${
firewall_port_end
}
-j
ACCEPT
fi
fi
save_firewall_settings
fi
}
function
firewall_remove
{
firewall_port
=
$1
firewall_protocol
=
"
$2
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment