Skip to content

Instantly share code, notes, and snippets.

@colstrom
Last active January 12, 2018 20:25
Show Gist options
  • Save colstrom/848c0354f1f0f4a3a39d5599c6f7245d to your computer and use it in GitHub Desktop.
Save colstrom/848c0354f1f0f4a3a39d5599c6f7245d to your computer and use it in GitHub Desktop.
#! /usr/bin/env ksh
# -*- shell-script -*-
function add-kernel-boot-parameter
{
perl -p -i -e 's/^(GRUB_CMDLINE_LINUX=)\"(?!.*'"${*}"')(.+)\"$/\1\"\2 '"${*}"'\"/' /etc/default/grub
}
# Usage
## add-kernel-boot-parameter cgroup_enable=memory
## add-kernel-boot-parameter swapaccount=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment