#!/bin/sh
### BEGIN INIT INFO
# Provides:          rmrecovery
# Required-Start:    $remote_fs $all
# Required-Stop:
# Default-Start:     1 2 3 4 5
# Default-Stop:
# Short-Description: Remove OpenSlug recovery file on successfull boot
# Description:       If instead of booting using the Debian initrd, you are
#                    using the OpenSlug firmware to boot Debian from a
#                    USB drive on your slug, then it creates a
#                    /.recovery file during boot, and unless this file
#                    is removed, the next boot will be back into the
#                    openslug system. This script removes this file on
#                    each boot, so that Debian will boot each time.
### END INIT INFO

case "$1" in
    start)
	# Run to remove /.recovery if the boot seems to have succeeded
	RMRECOVERY=yes
	. /etc/default/rmrecovery || true
	if [ "$RMRECOVERY" != no ]; then
	    rm -f /.recovery
	fi
	;;
    stop|restart|force-reload|*)
	;;
esac
