PageRenderTime 87ms CodeModel.GetById 83ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 1ms

/rc4.d/S99grub-common

http://github.com/brinkman83/bashrc
Shell | 42 lines | 22 code | 5 blank | 15 comment | 7 complexity | f5078cf9df66751dec9ae8f7baf4a0c2 MD5 | raw file
 1#! /bin/sh
 2### BEGIN INIT INFO
 3# Provides:          grub-common
 4# Required-Start:    $all
 5# Required-Stop:
 6# Default-Start:     2 3 4 5
 7# Default-Stop:
 8# Short-Description: Record successful boot for GRUB
 9# Description:       GRUB displays the boot menu at the next boot if it
10#                    believes that the previous boot failed. This script
11#                    informs it that the system booted successfully.
12### END INIT INFO
13
14which grub-editenv >/dev/null 2>&1 || exit 0
15
16# Load the VERBOSE setting and other rcS variables
17. /lib/init/vars.sh
18
19# Define LSB log_* functions.
20# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
21. /lib/lsb/init-functions
22
23case $1 in
24    start|restart|force-reload)
25	[ "$VERBOSE" != no ] && log_action_msg "Recording successful boot for GRUB"
26	[ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv
27	mkdir -p /boot/grub
28	grub-editenv /boot/grub/grubenv unset recordfail
29	[ "$VERBOSE" != no ] && log_end_msg $?
30	;;
31    stop)
32	;;
33    status)
34	exit 0
35	;;
36    *)
37	echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
38	exit 3
39	;;
40esac
41
42exit 0