Add DNS to config

This commit is contained in:
RealStickman 2021-07-07 15:53:25 +02:00
parent 17f206fa2d
commit b697ee74c3

View File

@ -29,15 +29,18 @@ for file in "${conffiles[@]}"; do
echo "Skipping $file" echo "Skipping $file"
else else
echo "Patching $file" echo "Patching $file"
# NOTE only one PreDown line is required as we are using a specific table for this # NOTE route while being connected into my lan
# lan
awk 'NR==5{print "PostUp = ip route add 192.168.1.0/24 via 172.16.52.1 metric 10"}NR==5{print "PreDown = ip route del 192.168.1.0/24"}1' "$file" > "${file}.tmp" awk 'NR==5{print "PostUp = ip route add 192.168.1.0/24 via 172.16.52.1 metric 10"}NR==5{print "PreDown = ip route del 192.168.1.0/24"}1' "$file" > "${file}.tmp"
mv "${file}.tmp" "$file"
# NOTE only one PreDown line is required as we are using a specific table for this
# TODO tables do not work as intended # TODO tables do not work as intended
#awk 'NR==5{print "PostUp = ip route add 192.168.1.0/24 via 192.168.86.1 metric 10 table 7"}NR==5{print "PreDown = ip route flush table 7"}1' "$file" > "${file}.tmp" #awk 'NR==5{print "PostUp = ip route add 192.168.1.0/24 via 192.168.86.1 metric 10 table 7"}NR==5{print "PreDown = ip route flush table 7"}1' "$file" > "${file}.tmp"
# NOTE adds a dns to all configs
awk 'NR==4{print "DNS = 172.16.16.1"}1' "$file" > "${file}.tmp"
mv "${file}.tmp" "$file" mv "${file}.tmp" "$file"
# wifi # wifi
#awk 'NR==6{print "PostUp = ip route add 192.168.1.0/24 via 172.16.52.1 metric 20 table 7"}1' "$file" > "${file}.tmp" #awk 'NR==6{print "PostUp = ip route add 192.168.1.0/24 via 172.16.52.1 metric 20 table 7"}1' "$file" > "${file}.tmp"
mv "${file}.tmp" "$file" #mv "${file}.tmp" "$file"
fi fi
done done