#!/bin/sh -efu

. /scripts/functions

tty=/dev/systty

stdin_needed() {
	set_lock tty 600
	/sbin/udevadm settle
	/bin/sh "$@" >"$tty" 2>"$tty" <"$tty"
}

[ "${1-}" = "--stdin" ] ||
	exec /bin/sh "$@" >"$tty" 2>"$tty"
shift
stdin_needed "$@" &
