router/link.fish

36 lines
770 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
# DNS, DHCP, prefix delegation
recopy dnsmasq.conf /etc/dnsmasq.conf
# let dnsmasq handle DNS
recopy resolved.conf /etc/systemd/resolved.conf
# sysctl flags we need for forwarding and accepting IPv6 router advertisements
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
# dhcp client configuration
recopy dhcpcd.conf /etc/dhcpcd.conf
# hosts file
recopy ./etc-hosts /etc/hosts