#!/usr/sbin/openrc-run

description="Remove /run/nologin at boot when DELAYLOGIN is enabled"

depend()
{
	need sudo
	keyword -docker -podman -prefix -systemd-nspawn -vserver
}

[ -n "${DELAYLOGIN}" ] || DELAYLOGIN=yes
. /lib/init/vars.sh

start()
{
	case "${DELAYLOGIN}" in
		Y*|y*)
			rm -f /run/nologin
			;;
	esac
	return 0
}

status()
{
	if [ ! -f /run/nologin ]; then
		return 0
	fi
	return 4
}
