mirror of
https://git.code.sf.net/p/zsh/code
synced 2026-04-25 18:12:27 -04:00
28 lines
574 B
Plaintext
28 lines
574 B
Plaintext
#compdef rebootin
|
|
|
|
local loader=$(sudo detectloader -q)
|
|
|
|
_arguments -C -s \
|
|
'-n[no immediate reboot just set the flags for next reboot]' \
|
|
'-f[create a /fastboot file to reboot in fastboot mode]' \
|
|
'*::arguments:->loader_entry'
|
|
|
|
local expl
|
|
case $state in
|
|
loader_entry)
|
|
case $loader in
|
|
GRUB)
|
|
if [ -r /boot/grub/menu.lst ];then
|
|
compadd ${${(M)${(f)"$(</boot/grub/menu.lst)"}##title *}#title }
|
|
fi
|
|
;;
|
|
LILO)
|
|
if [ -r /etc/lilo.conf ];then
|
|
compadd $(awk -F= '{ if ($0 ~ /label=/) print $2 }' /etc/lilo.conf)
|
|
fi
|
|
;;
|
|
*)
|
|
;;
|
|
esac
|
|
esac
|