Skip to content

Instantly share code, notes, and snippets.

@tonejito
Last active November 22, 2017 21:30
Show Gist options
  • Save tonejito/ee29ee7eb42ae2dec6a6dbcc99e17c22 to your computer and use it in GitHub Desktop.
Save tonejito/ee29ee7eb42ae2dec6a6dbcc99e17c22 to your computer and use it in GitHub Desktop.
update-grub alias for RHEL-ish distros
#!/bin/sh
# 0755 root:root /usr/sbin/update-grub
# update-grub is not provided on RHEL-ish distros
set -e
exec grub2-mkconfig -o /boot/grub2/grub.cfg "$@"
# 0644 root:root /etc/profile.d/update-grub.sh
# update-grub is not provided on RHEL-ish distros
if [ -n "$BASH_VERSION" ]
then
alias update-grub='grub2-mkconfig -o /boot/grub2/grub.cfg'
fi
@tonejito
Copy link
Author

[root@centos7 ~]# which update-grub
alias update-grub='grub2-mkconfig -o /boot/grub2/grub.cfg'
	/sbin/grub2-mkconfig

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment