|
|
@ -1,6 +1,6 @@
|
|
|
|
#!/bin/bash -e
|
|
|
|
#!/bin/bash -e
|
|
|
|
|
|
|
|
|
|
|
|
address=$(ip address show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?) .*#$1#')
|
|
|
|
address=$(ip address show dev eth0 scope global | grep -F 'inet ' | perl -pe 's#.*inet (.*?)/.*#$1#')
|
|
|
|
gateway=$(ip route list dev eth0 default | perl -pe 's#.*via ##')
|
|
|
|
gateway=$(ip route list dev eth0 default | perl -pe 's#.*via ##')
|
|
|
|
|
|
|
|
|
|
|
|
# $interface differs from the live system because of different naming schemes
|
|
|
|
# $interface differs from the live system because of different naming schemes
|
|
|
@ -12,5 +12,8 @@ echo "[Match]
|
|
|
|
Name=$interface
|
|
|
|
Name=$interface
|
|
|
|
|
|
|
|
|
|
|
|
[Network]
|
|
|
|
[Network]
|
|
|
|
Address=$address
|
|
|
|
Gateway=$gateway
|
|
|
|
Gateway=$gateway" > "/etc/systemd/network/${interface}.network"
|
|
|
|
|
|
|
|
|
|
|
|
[Address]
|
|
|
|
|
|
|
|
Address=${address}/32
|
|
|
|
|
|
|
|
Peer=${gateway}/32" > "/etc/systemd/network/${interface}.network"
|