2013年2月21日 星期四

[TTYUSB0] How to send message to console from remote machine

[TTYUSB0] How to send message to console from remote machine

1. Type

local machine send message to remote machine.

ssh 192.168.100.100 -l happy "bash /home/happy/tftp/auto_ssh.sh"

2. Create a bash script

#!/bin/bash

# cp file from A place to tftp

DATE=`date +%m%d`

Filename='13'$DATE'.img'

Sever_IP='/home/happy/192.168.100.100/luke/'

Folder_Date='20130221-09-37'

File_Position=$Sever_IP''$Folder_Date'/happy/'



echo $File_Position$Filename

rm $Filename

rsync -azv --progress $File_Position$Filename .

chmod 777 ./$Filename



# change ifconfig eth0 IP address

sudo ifconfig $interface 192.168.100.20

ifconfig

sleep 1



#use xdotool finish download code into board

echo 'set serverip 192.168.100.20' > /dev/ttyUSB0

sleep 0.1 ## After echo must have sleep, otherwish no send string to /dev/ttyUSB0

echo "set NAME2 $Filename" > /dev/ttyUSB0

sleep 0.1

echo "run up2" > /dev/ttyUSB0

sleep 0.1



3. show console by using "cat -v < /dev/ttyUSB0"

0 意見:

張貼留言