summaryrefslogtreecommitdiffstats
path: root/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh
diff options
context:
space:
mode:
authorJonathan Bauer2020-05-13 11:04:02 +0200
committerJonathan Bauer2020-05-13 11:04:02 +0200
commit1130873aa55c9b0a7e5af48edc44bd6c6fd1f888 (patch)
tree0fcfa186cd631d8d36611b3d4bc509fd38841d51 /modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh
parentMerge branch 'centos8' into downloader (diff)
downloadsystemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.tar.gz
systemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.tar.xz
systemd-init-1130873aa55c9b0a7e5af48edc44bd6c6fd1f888.zip
restructure repo
* remove packager * move everything from builder/* back to root
Diffstat (limited to 'modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh')
-rwxr-xr-xmodules.d/bootnet-conf/scripts/gen-bootnet-conf.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh b/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh
new file mode 100755
index 00000000..ec82f143
--- /dev/null
+++ b/modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+type emergency_shell >/dev/null 2>&1 || source /lib/dracut-lib.sh
+
+mac="$(getargs BOOTIF=)"
+mac="$(echo $mac | cut -c 4- | tr '-' ':')"
+if [ -n "${mac}" ]; then
+ cat << EOF >> "${NEWROOT}/etc/sysconfig/network-scripts/ifcfg-bootnet"
+DEVICE=bootnet
+NAME=bootnet
+HWADDR=${mac}
+BOOTPROTO=dhcp
+ONBOOT=yes
+NM_CONTROLLED=yes
+EOF
+else
+ echo "Could not parse MAC"
+fi