#!/bin/sh
### BEGIN INIT INFO
# Provides:          autopkgtest
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
### END INIT INFO

if [ "$1" = start ]; then
    for device in ttyS1 hvc1; do
        if [ -e "/dev/$device" ]; then
            echo "Starting root shell on $device for autopkgtest"
            (setsid sh <"/dev/$device" >"/dev/$device" 2>&1) &
        fi
    done
fi
