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:27:12 -0500
commitbb184e13b4806c56e095a1a33c4fc3ea281bdd29 (patch)
tree35768bdb2283e474004376603b4cab44be2ceeba /chapter9/network.sh
parent057e88552151997d0ffb6f0fd306f5c9830a596e (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 05ab2fd..e82e29e 100644
--- a/chapter9/network.sh
+++ b/chapter9/network.sh
@@ -1,26 +1,19 @@
#!/bin/bash
-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