#!/bin/sh -efu

. /.initrd/initenv
. rdshell-sh-functions

delay=${ROOTDELAY:-180}
while [ "$delay" -gt 0 ] && [ ! -x "$rootmnt/$INIT" ]; do
	delay=$(($delay - 1))
	sleep 1
done

[ ! -x "$rootmnt/$INIT" ] ||
	exit 0

# Disallow console access
[ "${PANIC-}" != 0 ] || reboot

echo "The waiting time expired!" > "$rdshell_fifo"
