Commit b1b259b4 authored by nanahira's avatar nanahira

support custom things

parent 105c24a0
...@@ -22,7 +22,7 @@ replace_ip() { ...@@ -22,7 +22,7 @@ replace_ip() {
# 检查 $INPUT 是否包含点 # 检查 $INPUT 是否包含点
if [[ "$INPUT" == *.* ]]; then if [[ "$INPUT" == *.* ]]; then
IFS='.' read -r -a INPUT_PARTS <<< "$INPUT" IFS='.' read -r -a INPUT_PARTS <<< "$INPUT"
PART_COUNT=${#INPUT_PARTS[@]} PART_COUNT=${{'{#'}}INPUT_PARTS[@]}
# 如果有 4 个或以上的部分,那么这是一个完整的 IP 地址,直接返回 # 如果有 4 个或以上的部分,那么这是一个完整的 IP 地址,直接返回
if [[ $PART_COUNT -ge 4 ]]; then if [[ $PART_COUNT -ge 4 ]]; then
echo "$INPUT" echo "$INPUT"
......
...@@ -15,6 +15,10 @@ iface lo inet loopback ...@@ -15,6 +15,10 @@ iface lo inet loopback
auto {{link.name}} auto {{link.name}}
iface {{link.name}} inet manual iface {{link.name}} inet manual
iface {{link.name}} inet6 manual iface {{link.name}} inet6 manual
{% if link.interfaces_custom is defined and link.interfaces_custom %}
### custom
{{link.interfaces_custom}}
{% endif %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
...@@ -53,6 +57,10 @@ bond-updelay 200 ...@@ -53,6 +57,10 @@ bond-updelay 200
bond-lacp-rate fast bond-lacp-rate fast
bond-xmit-hash-policy {{ bond.hash_policy | default('layer2+3') }} bond-xmit-hash-policy {{ bond.hash_policy | default('layer2+3') }}
{% endif %} {% endif %}
{% if bond.interfaces_custom is defined and bond.interfaces_custom %}
### custom
{{bond.interfaces_custom}}
{% endif %}
{% endfor %} {% endfor %}
...@@ -144,6 +152,11 @@ provider ppp{{ppp.id}} ...@@ -144,6 +152,11 @@ provider ppp{{ppp.id}}
# end PPPs # end PPPs
{% endif %} {% endif %}
{% if interfaces_custom is defined and interfaces_custom %}
### custom
{{interfaces_custom}}
{% endif %}
# end MyCard NextGen Router config file # end MyCard NextGen Router config file
source /etc/network/interfaces.d/* source /etc/network/interfaces.d/*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment