aboutsummaryrefslogtreecommitdiffstats
path: root/chapter9/network.sh
diff options
context:
space:
mode:
authorWilliam Harrington <kb0iic@berzerkula.org>2021-04-20 10:27:12 -0500
committerWilliam Harrington <kb0iic@berzerkula.org>2021-04-20 10:29:29 -0500
commit215feb45ed5a9c0ebc1863aba05cdcce30501375 (patch)
tree415e42033123b23a4bcdba33d24c3aca9619b143 /chapter9/network.sh
parent8e381701594e3ccadbdd507d084548325d9f2fbe (diff)
Adjust for systemd specific builds.
Diffstat (limited to 'chapter9/network.sh')
-rw-r--r--chapter9/network.sh29
1 files changed, 11 insertions, 18 deletions
diff --git a/chapter9/network.sh b/chapter9/network.sh
index 4b778cf..d75c5b8 100644
--- a/chapter9/network.sh
+++ b/chapter9/network.sh
@@ -1,27 +1,20 @@
#!/bin/bash
set -e
-pushd /etc/sysconfig/ >/dev/null || exit 1
-cat > ifconfig.eth0 << "EOF"
-ONBOOT=yes
-IFACE=eth0
-SERVICE=ipv4-static
-IP=192.168.1.196
-GATEWAY=192.168.1.1
-PREFIX=24
-BROADCAST=192.168.1.255
-EOF
-popd >/dev/null || exit 1
-
-cat > /etc/resolv.conf << "EOF"
-# Begin /etc/resolv.conf
+pushd /etc/systemd/network >/dev/null || exit 1
+cat > 10-eth-dhcp.network << "EOF"
+[Match]
+Name=eth0
-nameserver 192.168.1.10
-domain berzerkula.org
-search berzerkula.org
+[Network]
+DHCP=ipv4
-# End /etc/resolv.conf
+[DHCP]
+UseDomains=true
EOF
+popd >/dev/null || exit 1
+
+ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf
echo "lfs" > /etc/hostname