From 81b0a9e0bad86ddec82e7462cd4f4915836de581 Mon Sep 17 00:00:00 2001 From: Cameron Thompson <50184035+iamromulan@users.noreply.github.com> Date: Mon, 25 Mar 2024 00:53:13 -0400 Subject: [PATCH] Update ttyd.bash Updated to use atcmd to obtain info Now shows the firmware version and serial number --- ttyd/scripts/ttyd.bash | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/ttyd/scripts/ttyd.bash b/ttyd/scripts/ttyd.bash index 13aeba3..59cf167 100644 --- a/ttyd/scripts/ttyd.bash +++ b/ttyd/scripts/ttyd.bash @@ -1,7 +1,9 @@ #!/bin/bash -# Read the serial number and remove the last two digits -serial_number=$(cat /sys/devices/soc0/serial_number | sed 's/..$//') +# Read the serial number +serial_number=$(atcmd 'AT+EGMR=0,5' | grep '+EGMR:' | cut -d '"' -f2) +# Read the firmware revision +firmware_revision=$(atcmd 'AT+CGMR' | grep -o 'RM[0-9A-Z]*' | head -1) echo "==============================================================" echo "==============================================================" @@ -82,9 +84,10 @@ echo " :@@@@@*. " echo " .=@@@@@- " echo " :+##+. " echo "==============================================================" -echo "Test ttyd startup file by iamromulan V0.1" -echo "quectel-ID: $serial_number" +echo "TTYd session file by iamromulan v1.0" +echo "Firmware Revision: $firmware_revision" +echo "Serial Number: $serial_number" echo "==============================================================" # Start a login session -exec /bin/login \ No newline at end of file +exec /bin/login