/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. which grub-editenv >/dev/null 2>&1 || exit 0
  14. # Load the VERBOSE setting and other rcS variables
  15. . /lib/init/vars.sh
  16. # Define LSB log_* functions.
  17. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
  18. . /lib/lsb/init-functions
  19. case $1 in
  20. start|restart|force-reload)
  21. [ "$VERBOSE" != no ] && log_action_msg "Recording successful boot for GRUB"
  22. [ -s /boot/grub/grubenv ] || rm -f /boot/grub/grubenv
  23. mkdir -p /boot/grub
  24. grub-editenv /boot/grub/grubenv unset recordfail
  25. [ "$VERBOSE" != no ] && log_end_msg $?
  26. ;;
  27. stop)
  28. ;;
  29. status)
  30. exit 0
  31. ;;
  32. *)
  33. echo "Usage: $0 {start|stop|status|restart|force-reload}" >&2
  34. exit 3
  35. ;;
  36. esac
  37. exit 0