Last active
November 29, 2022 22:29
-
-
Save arter97/561b9cd5ccbbbcaee11498874f46b8e4 to your computer and use it in GitHub Desktop.
kexec reboot helper for Ubuntu
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/bash | |
# Store at /usr/local/sbin/reboot with 755 permission | |
echo "" | |
echo "Using kexec for faster reboot." | |
echo "" | |
echo "If you want to perform a full reboot," | |
echo "use 'systemctl reboot' instead." | |
echo "" | |
sudo kexec \ | |
-l $(ls /boot/vmlinuz-* | sort -V | tail -n1) \ | |
--initrd=$(ls /boot/vmlinuz-* | sort -V | tail -n1 | sed s/vmlinuz/initrd.img/g) \ | |
--reuse-cmdline && sudo systemctl kexec |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment