Created
December 20, 2024 20:01
-
-
Save darkexplosiveqwx/cc1bb3ecfeaf2bf9e28eb506df01c7ae to your computer and use it in GitHub Desktop.
Adds boot menu entries for Rebooting and Halting to grub
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
| #!/bin/sh | |
| # This script adds "Reboot" and "Shutdown" menu entries to GRUB. | |
| # Make executable by sudo chmod +x /etc/grub.d/40_reboot_shutdown | |
| # Place in /etc/grub.d | |
| set -e | |
| prefix="/usr" | |
| exec_prefix="/usr" | |
| datarootdir="/usr/share" | |
| export TEXTDOMAIN=grub | |
| export TEXTDOMAINDIR="${datarootdir}/locale" | |
| . "$pkgdatadir/grub-mkconfig_lib" | |
| LABEL_REBOOT="Reboot" | |
| LABEL_SHUTDOWN="Shutdown" | |
| gettext_printf "Adding boot menu entries for Reboot and Shutdown ...\n" >&2 | |
| # Output the menu entries | |
| cat << EOF | |
| menuentry '$(gettext "$LABEL_REBOOT")' \$menuentry_id_option 'Reboot' { | |
| reboot | |
| } | |
| menuentry '$(gettext "$LABEL_SHUTDOWN")' \$menuentry_id_option 'Shutdown' { | |
| halt | |
| } | |
| EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment