router/link.fish

32 lines
756 B
Fish
Raw Permalink Normal View History

2021-07-10 14:04:31 -05:00
#!/usr/bin/env fish
2022-01-31 11:40:03 -06:00
if test (id -u) -ne 0
echo "must run as root"
exit 1
end
function relink
2021-07-11 00:34:29 -05:00
rm -f $argv[2]
2021-07-10 14:04:31 -05:00
ezln $argv[1] $argv[2]
end
2022-01-31 11:40:03 -06:00
function recopy
rm -f $argv[2]
cp $argv[1] $argv[2]
end
2022-01-31 16:44:36 -06:00
recopy dnsmasq.conf /etc/dnsmasq.conf
recopy resolved.conf /etc/systemd/resolved.conf
recopy ./sysctl-configs /etc/sysctl.d/10-router-configs.conf
2022-01-31 11:40:03 -06:00
2022-01-31 16:44:36 -06:00
# enable systemd-networkd to setup network interfaces with useful names
2022-01-31 11:40:03 -06:00
recopy lan0.link /etc/systemd/network/10-lan0.link
recopy wan0.link /etc/systemd/network/10-wan0.link
2022-01-31 16:44:36 -06:00
# enable systemd-networkd set the proper sysctl flags
# recopy wan0.network /etc/systemd/network/wan0.network
# recopy lan0.network /etc/systemd/network/lan0.network
2021-07-10 14:04:31 -05:00
2022-01-31 16:44:36 -06:00
# dhcp client configuration
recopy dhcpcd.conf /etc/dhcpcd.conf