summaryrefslogtreecommitdiff
path: root/Completion/Mandriva/Command/_rebootin
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/Mandriva/Command/_rebootin')
-rw-r--r--Completion/Mandriva/Command/_rebootin27
1 files changed, 27 insertions, 0 deletions
diff --git a/Completion/Mandriva/Command/_rebootin b/Completion/Mandriva/Command/_rebootin
new file mode 100644
index 000000000..5a27bf800
--- /dev/null
+++ b/Completion/Mandriva/Command/_rebootin
@@ -0,0 +1,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