router/link.fish
Daniel Flanagan 20f1439af8 WIP
2022-01-31 16:44:36 -06:00

31 lines
756 B
Fish
Executable file

#!/usr/bin/env fish
if test (id -u) -ne 0
echo "must run as root"
exit 1
end
function relink
rm -f $argv[2]
ezln $argv[1] $argv[2]
end
function recopy
rm -f $argv[2]
cp $argv[1] $argv[2]
end
recopy dnsmasq.conf /etc/dnsmasq.conf
recopy resolved.conf /etc/systemd/resolved.conf
recopy ./sysctl-configs /etc/sysctl.d/10-router-configs.conf
# enable systemd-networkd to setup network interfaces with useful names
recopy lan0.link /etc/systemd/network/10-lan0.link
recopy wan0.link /etc/systemd/network/10-wan0.link
# enable systemd-networkd set the proper sysctl flags
# recopy wan0.network /etc/systemd/network/wan0.network
# recopy lan0.network /etc/systemd/network/lan0.network
# dhcp client configuration
recopy dhcpcd.conf /etc/dhcpcd.conf