Last active
September 24, 2015 14:47
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 | |
# A script for access console and log the output. | |
# A script for access console and log the output. | |
# Usage: | |
# $ DEVICE=/dev/ttyUSB0 SPEED=51200 kermit.sh | |
# | |
# Copyright (c) Rex Tsai <chihchun@kalug.linux.org.tw> | |
# $Id: $ | |
# SPEED=9600 | |
# SPEED=38400 | |
# SPEED=115200 | |
CFGFILE=$(mktemp /tmp/kermit-cfg.XXXXXX) | |
LOGFILE=$(mktemp /tmp/kermit-log.XXXXXX) | |
cat > ${CFGFILE} <<EOF | |
log session ${LOGFILE} | |
set line ${DEVICE:=/dev/ttyUSB0} | |
set speed ${SPEED:=115200} | |
set parity none | |
set carrier-watch off | |
set flow-control auto | |
set serial 8n1 | |
robust | |
set protocol zmodem | |
connect | |
quit | |
EOF | |
/usr/bin/kermit ${CFGFILE} | |
# we don't need to config file anymore, | |
# since it's created dynamicly. | |
rm ${CFGFILE} | |
# After you quit kermit by Ctrl-\ + Ctrl-C (defalut seeting) | |
# We tell the user which file is the log file. | |
echo "Session Log file: ${LOGFILE}" | |
# rm ${LOGFILE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment