Update ubuntuInit.sh

This commit is contained in:
Molly Lau 2023-10-24 20:13:28 +09:00 committed by GitHub
parent f290099ea3
commit 79359d9dea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,7 +2,14 @@
#
# Alpine Linux use "ash" as the default shell.
exec >/dev/tty0 2>&1
# Find available tty.
for ttyItems in "/dev/tty0" "/dev/ttyS0" "/dev/ttyAMA0"; do
ttyAttribute=$(stty -F "$ttyItems")
[[ -n "$ttyAttribute" && -n $(echo "$ttyAttribute" | grep -io "\-brkint ixoff \-imaxbel") ]] && {
break
}
done
exec >"$ttyItems" 2>&1
# Delete the initial script itself to prevent to be executed in the new system.
rm -f /etc/local.d/ubuntuConf.start