mirror of
https://github.com/elitak/nixos-infect.git
synced 2024-12-22 16:18:29 +03:00
eth1 does not get configured on DigitalOcean when using a VPC (#163)
* fixed issue where interfaces1 isn't set on DigitalOcean with VPC * missing curly bracket
This commit is contained in:
parent
b26a9f2668
commit
d52253d559
1 changed files with 3 additions and 1 deletions
|
@ -109,7 +109,7 @@ makeNetworkingConf() {
|
||||||
eth1_ip4s=$(ip address show dev "$eth1_name" | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')
|
eth1_ip4s=$(ip address show dev "$eth1_name" | grep 'inet ' | sed -r 's|.*inet ([0-9.]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|')
|
||||||
eth1_ip6s=$(ip address show dev "$eth1_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || '')
|
eth1_ip6s=$(ip address show dev "$eth1_name" | grep 'inet6 ' | sed -r 's|.*inet6 ([0-9a-f:]+)/([0-9]+).*|{ address="\1"; prefixLength=\2; }|' || '')
|
||||||
ether1=$(ip address show dev "$eth1_name" | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')
|
ether1=$(ip address show dev "$eth1_name" | grep link/ether | sed -r 's|.*link/ether ([0-9a-f:]+) .*|\1|')
|
||||||
interfaces1=<< EOF
|
interfaces1=$(cat << EOF
|
||||||
$eth1_name = {
|
$eth1_name = {
|
||||||
ipv4.addresses = [$(for a in "${eth1_ip4s[@]}"; do echo -n "
|
ipv4.addresses = [$(for a in "${eth1_ip4s[@]}"; do echo -n "
|
||||||
$a"; done)
|
$a"; done)
|
||||||
|
@ -117,7 +117,9 @@ makeNetworkingConf() {
|
||||||
ipv6.addresses = [$(for a in "${eth1_ip6s[@]}"; do echo -n "
|
ipv6.addresses = [$(for a in "${eth1_ip6s[@]}"; do echo -n "
|
||||||
$a"; done)
|
$a"; done)
|
||||||
];
|
];
|
||||||
|
};
|
||||||
EOF
|
EOF
|
||||||
|
)
|
||||||
extraRules1="ATTR{address}==\"${ether1}\", NAME=\"${eth1_name}\""
|
extraRules1="ATTR{address}==\"${ether1}\", NAME=\"${eth1_name}\""
|
||||||
else
|
else
|
||||||
interfaces1=""
|
interfaces1=""
|
||||||
|
|
Loading…
Reference in a new issue