Skip to content

Instantly share code, notes, and snippets.

@jongillies
Created August 23, 2019 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jongillies/5ffe878c2baf0e992b41ad3defeae092 to your computer and use it in GitHub Desktop.
Save jongillies/5ffe878c2baf0e992b41ad3defeae092 to your computer and use it in GitHub Desktop.
Regex Majic
#!/usr/bin/env bash
cat << EOF > grub.orig.conf
# If you change this file, run 'update-grub' afterwards to update
GRUB_DEFAULT=0
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 "
# Uncomment to enable BadRAM filtering, modify to suit your needs
EOF
cat << EOF
Objective-> Using the created file grub.orig.conf, create a regex inline replace to meet the following:
Make the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
be:
GRUB_CMDLINE_LINUX_DEFAULT="quiet ipv6.disable=1"
And:
Make the line:
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 "
be:
GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0 ipv6.disable=1"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment