#!/bin/sh

getty_is_enabled()
{
    grep -qwF 'androidboot.rh_unlock=1' /proc/cmdline
}

if getty_is_enabled ; then
	exec /sbin/getty "$@"
else
	# can't just exit here because init will respawn
	exec sleep infinity
fi
