summary refs log tree commit diff
path: root/Completion/Mandriva/Command/_rebootin
blob: 5a27bf800c653aad5bec6b17d3f7bd24f9faec55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#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