Hi Ronen,
Here are the script I am using. I am not a coded so maybe there is a better way but these 2 script are working for my purpose.
Here it is with out warranty or support.
------------------------------------- #!/bin/sh # 8-Jan-2016 KD4YAL # #HOME=/home/myhome # rm -rf encap.txt # wget ftp://USER:PASSWORD@portal.ampr.org/encap.txt # # echo -e "Download Completed ........." # echo -e "Converting Encap.txt for the ampr-tunnel-config script......" # remove old ampr-tunnel-config rm -rf ampr-tunnel-config.txt # perl /home/myhome/encapconvertnew.pl encap.txt # /home/jdelong/perl encapconvertnew.pl encap.txt echo -e "The Script is Completed....." # echo -e "dumping ampr-tunnel-config script to router" # connect to router /home/myhome/script2 # echo -e "Routing updates completed....." # <EOF>
#!/usr/bin/expect #8-Jan-2016 KD4YAL # # Get the commands to run, one per line set f [open "/home/myhome/ampr-tunnel-config.txt"] set commands [split [read $f] "\n"] close $f # spawn ssh MYUSERNAME@ROUTERIP expect "?assword:" send "MYPASSWORD\r" # Goto configure mode expect "#" send "conf t\r" #
# Iterate over the commands foreach cmd $commands { expect "(config" send "$cmd\r" }
# Tidy up expect "#" send "wr mem\r" expect "#" send "exit\r" expect eof
---------------------------------------
Jerry, KD4YAL
On Fri, Mar 4, 2016 at 10:25 AM, R P ronenp@hotmail.com wrote:
(Please trim inclusions from previous messages) _______________________________________________ Hi there
My CS8251 works very well
I need a idea how to make it get the Updated encap file automatically
I do it now by Cut and paste but know that TFTP can do the job as well
I need a solution that this can be done automatic (by batch or script)
Any ideas , Solutions welcome
Regards
Ronen - 4Z4ZQ
Ronen Pinchooks (4Z4ZQ) WebSitehttp://www.ronen.org/ www.ronen.org ronen.org (Ronen Pinchooks (4Z4ZQ) WebSite) is hosted by domainavenue.com