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"

Related Posts:

  • [PIC resize] convert for f in *.jpg; do convert "$f" -resize 640x480 -strip -quality 86 "$f"; done 1.That will go through all .jpg-images in current … Read More
  • [crontab] routine job (1) nano /etc/crontab  make a routine job. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root # For details see man 4 crontabs # E… Read More
  • [rsync] rsync參數詳解 出處:瘋狂老頭BLOG、藍色泡泡 選項說明(版本 2.6.3) -v, --verbose 詳細模式輸出訊息 -q, --quiet 安靜模式,幾乎沒有訊息產生。常用在以 cron 執行 rsync -c, --checksum 打在傳送之前透過 128bit 的 MD4 檢查碼… Read More
  • [Ubuntu] Install command (Lazy) #!/bin/bash # #************************************************************************** #*         &nb… Read More
  • [Ubuntu command] rsyncrsync -avz --progress /home/freeman/Backup/ /media/ABUNDANT/ Reference : http://ohaha.ks.edu.tw/old_site/rsyncd.htm … Read More

0 意見:

張貼留言