#! /bin/sh
### BEGIN INIT INFO
# Provides:          rmnologin
# Required-Start:    $local_fs $remote_fs
# Required-Stop: 
# Should-Start:      kdm xdm gdm $syslog
# Default-Start:     0 1 2 3 4 5 6
# Default-Stop:       
# Short-Description: Remove /etc/nologin at boot
# Description:       This script removes the /etc/nologin file as the last
#                    step in the boot process, if DELAYLOGIN=yes.  If
#                    DELAYLOGIN=no, /etc/nologin was not created by by
#                    bootmisc earlier in the boot process.
### END INIT INFO
#
# Version:	@(#)rmnologin  2.85-13  22-Mar-2004  miquels@cistron.nl
#

[ -z "$DELAYLOGIN" ] && DELAYLOGIN=yes
[ -f /etc/default/rcS ] && . /etc/default/rcS

PATH=/lib/init:/sbin:/bin

do_start () {
	case "$DELAYLOGIN" in
		Y*|y*)
			#
			#	If /etc/nologin is a symbolic link,
			#	remove the destination instead of the link.
			#
			rm -f "`readlink -f /etc/nologin || :`"
			;;
	esac
}

case "$1" in
    start)
        do_start
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

: exit 0
