mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 05:34:34 +08:00
Update alpineInit.sh
This commit is contained in:
parent
d31bc612a6
commit
f290099ea3
1 changed files with 9 additions and 3 deletions
|
@ -2,9 +2,15 @@
|
||||||
#
|
#
|
||||||
# Alpine Linux use "ash" as the default shell.
|
# Alpine Linux use "ash" as the default shell.
|
||||||
|
|
||||||
exec >/dev/tty0 2>&1
|
# Find available tty.
|
||||||
exec >/dev/ttyS0 2>&1
|
# Parameters of outputs of "stty": https://www.ibm.com/docs/en/aix/7.3?topic=s-stty-command
|
||||||
exec >/dev/ttyAMA0 2>&1
|
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
|
||||||
|
|
||||||
insertIntoFile() {
|
insertIntoFile() {
|
||||||
file=$1
|
file=$1
|
||||||
|
|
Loading…
Reference in a new issue