2014年4月8日 星期二

[Bash Script][xdotool] How to use xdotool to download firmware automatically (P6)


[Bash Script][xdotool] How to use xdotool to download firmware automatically (P6)



#!/bin/bash

# cp file from A place to tftp

DATE=`date +%m%d`

Comannd='set'

Parameter='UBFINAME1 '

Filename='vgwsdk_4.3.0.37-14'$DATE'_npcpu-appcpu.img'



# change ifconfig eth0 IP address

# sudo ifconfig eth0 192.168.100.20

# ifconfig

# sleep 1



#Into Settings



xdotool key alt+1

xdotool type 'settings'

xdotool key 'Return'

sleep 0.1



xdotool keydown

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key 'Return'

sleep 0.1



# Select GbE GMUX Mode



xdotool keydown

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1





xdotool key Right

sleep 0.1



# Select Boot Type





xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Right

sleep 0.1



# save the settings

xdotool key F3

sleep 0.1



# reboot

xdotool type 'reset'

xdotool key 'Return'

sleep 3





# press space

xdotool key space



# burn image



xdotool type 'tftp get 192.168.100.20 0x900000 ' $Filename

xdotool key 'Return'

sleep 7



# flush partion



xdotool type 'cache flush'

xdotool key 'Return'

sleep 1





# update ARM 1 & ARM 2



xdotool type 'update -t all 1'

xdotool key 'Return'

sleep 5





xdotool type 'update -t all 2'

xdotool key 'Return'

sleep 5





#Into Settings



xdotool type 'settings'

xdotool key 'Return'

sleep 0.1



xdotool keydown

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key 'Return'

sleep 0.1



# Select GbE GMUX Mode



xdotool keydown

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1





xdotool key Left

sleep 0.1



# Select Boot Type





xdotool key Down

sleep 0.1



xdotool key Down

sleep 0.1



xdotool key Left

sleep 0.1



# save the settings

xdotool key F3

sleep 0.1



# reboot

xdotool type 'reset'

xdotool key 'Return'

sleep 3



 


Related Posts:

0 意見:

張貼留言