Last active
January 12, 2018 20:25
-
-
Save colstrom/848c0354f1f0f4a3a39d5599c6f7245d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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