Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
nextgen-router
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
nextgen-router
Commits
b1b259b4
Commit
b1b259b4
authored
Dec 02, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support custom things
parent
105c24a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
2 deletions
+15
-2
files/bridge-post-scripts/post-up.sh.j2
files/bridge-post-scripts/post-up.sh.j2
+2
-2
files/interfaces.j2
files/interfaces.j2
+13
-0
No files found.
files/bridge-post-scripts/post-up.sh.j2
View file @
b1b259b4
...
...
@@ -22,14 +22,14 @@ replace_ip() {
# 检查 $INPUT 是否包含点
if
[[
"
$INPUT
"
==
*
.
*
]]
;
then
IFS
=
'.'
read
-r
-a
INPUT_PARTS
<<<
"
$INPUT
"
PART_COUNT
=
${
#
INPUT_PARTS
[@]
}
PART_COUNT
=
${
{
'{#'
}
}
INPUT_PARTS[@]
}
# 如果有 4 个或以上的部分,那么这是一个完整的 IP 地址,直接返回
if
[[
$PART_COUNT
-ge
4
]]
;
then
echo
"
$INPUT
"
else
# 根据 PART_COUNT,补全 IP 地址
AWK_SCRIPT
=
'{print '
for
((
i
=
0
;
i <
$((
4
-
PART_COUNT
))
;
i++
))
;
do
AWK_SCRIPT
=
"
${
AWK_SCRIPT
}
\$
$((
i
+
1
))
"
if
[[
$i
-lt
3
]]
;
then
...
...
files/interfaces.j2
View file @
b1b259b4
...
...
@@ -15,6 +15,10 @@ iface lo inet loopback
auto {{link.name}}
iface {{link.name}} inet manual
iface {{link.name}} inet6 manual
{% if link.interfaces_custom is defined and link.interfaces_custom %}
### custom
{{link.interfaces_custom}}
{% endif %}
{% endfor %}
{% endif %}
...
...
@@ -53,6 +57,10 @@ bond-updelay 200
bond-lacp-rate fast
bond-xmit-hash-policy {{ bond.hash_policy | default('layer2+3') }}
{% endif %}
{% if bond.interfaces_custom is defined and bond.interfaces_custom %}
### custom
{{bond.interfaces_custom}}
{% endif %}
{% endfor %}
...
...
@@ -144,6 +152,11 @@ provider ppp{{ppp.id}}
# end PPPs
{% endif %}
{% if interfaces_custom is defined and interfaces_custom %}
### custom
{{interfaces_custom}}
{% endif %}
# end MyCard NextGen Router config file
source /etc/network/interfaces.d/*
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment