diff options
Diffstat (limited to 'modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh')
-rwxr-xr-x | modules.d/bootnet-conf/scripts/gen-bootnet-conf.sh | 18 |
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 |