aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin/reboot-into-windows
diff options
context:
space:
mode:
authorEgor Tensin <egor@tensin.name>2025-09-08 11:47:32 +0200
committerEgor Tensin <egor@tensin.name>2025-09-08 11:47:59 +0200
commit7df8e5e3a3018f4c8583d623ddcf63deba10a237 (patch)
treed9032298b049c36afdf12e2efbf0ae7f913b9909 /bin/reboot-into-windows
parentsplit AUR-related stuff to the aur branch (diff)
downloadgrub-reboot-into-windows-7df8e5e3a3018f4c8583d623ddcf63deba10a237.tar.gz
grub-reboot-into-windows-7df8e5e3a3018f4c8583d623ddcf63deba10a237.zip
rename to grub-reboot-into-windowsv0.1
Diffstat (limited to 'bin/reboot-into-windows')
-rwxr-xr-xbin/reboot-into-windows43
1 files changed, 0 insertions, 43 deletions
diff --git a/bin/reboot-into-windows b/bin/reboot-into-windows
deleted file mode 100755
index a6584b9..0000000
--- a/bin/reboot-into-windows
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env bash
-
-set -o errexit -o nounset -o pipefail
-shopt -s inherit_errexit lastpipe
-
-readonly cfg_path=/boot/grub/grub.cfg
-
-get_windows_menu_entry() {
- local windows_entries
- windows_entries="$( awk -F\' '/menuentry / {print $2}' "$cfg_path" | grep -Fi Windows )"
-
- local numof_entries
- numof_entries="$( echo "$windows_entries" | wc -l )"
-
- if [ "$numof_entries" -ne 1 ]; then
- echo "Don't know which one of the following entries to select:" >&2
- echo "$windows_entries" >&2
- return 1
- fi
-
- echo "$windows_entries"
-}
-
-main() {
- local entry
- entry="$( get_windows_menu_entry )"
-
- # grub-reboot returns 0 even if something like a permission error happens.
- # It does print something in that case though, and nothing after a
- # successful termination.
- local output
- output="$( grub-reboot "$entry" )"
-
- if [ -n "$output" ]; then
- echo "grub-reboot probably exited with an error:" >&2
- echo "$output" >&2
- return 1
- fi
-
- reboot
-}
-
-main