Last active
December 13, 2023 03:22
-
-
Save gris-gris/2c4e71e959d9cf4fc1902f950efe484d to your computer and use it in GitHub Desktop.
Simple script for connecting to TuringPi2 Serial console from BMC SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Slot Devnode | |
# Slot 1 /dev/ttyS2 | |
# Slot 2 /dev/ttyS1 | |
# Slot 3 /dev/ttyS4 | |
# Slot 4 /dev/ttyS5 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 <slot_number>" | |
exit 1 | |
fi | |
slot_number="$1" | |
case "$slot_number" in | |
1) | |
console_number=2 | |
;; | |
2) | |
console_number=1 | |
;; | |
3) | |
console_number=4 | |
;; | |
4) | |
console_number=5 | |
;; | |
*) | |
echo "Invalid slot number. Please use a number between 1 and 4." | |
exit 1 | |
;; | |
esac | |
microcom -s 115200 "/dev/ttyS$console_number" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment