mirror of
https://github.com/apricote/home-cloud.git
synced 2026-01-13 21:11:02 +00:00
21 lines
384 B
Bash
21 lines
384 B
Bash
|
|
#!/bin/bash
|
||
|
|
%{ if use_netdata }
|
||
|
|
cat >> /etc/netplan/60-floating.cfg <<- EOM
|
||
|
|
network:
|
||
|
|
version: 2
|
||
|
|
ethernets:
|
||
|
|
eth0:
|
||
|
|
addresses:
|
||
|
|
- ${floating_ip}/32
|
||
|
|
EOM
|
||
|
|
netplan apply
|
||
|
|
%{ else }
|
||
|
|
cat >> /etc/network/interfaces.d/99-floating.cfg <<- EOM
|
||
|
|
auto eth0:1
|
||
|
|
iface eth0:1 inet static
|
||
|
|
address ${floating_ip}
|
||
|
|
netmask 255.255.255.255
|
||
|
|
EOM
|
||
|
|
ifdown eth0:1 ; ifup eth0:1
|
||
|
|
%{ endif }
|