$ cat script.sh
#!/bin/bash
######################################################################
#export https_proxy=http://10.215.70.65:8080
export https_proxy=http://10.xx.xx.xx:8080
flash() {
echo ""
echo "====================================================================="
echo " ---> Collecting the Binaries Versions
<--- "
echo "====================================================================="
echo ' \\\|///
'
echo ' \\ - - // '
echo " ( @ @ )
"
echo " -----oOOo-(_)-oOOo------------- "
echo "
| |"
echo " | `date "+%d/%m/%Y"` Wissem MEDIOUNI |"
echo " | [email protected] |"
echo "
| |"
echo " ------------------------------- "
echo "====================================================================="
echo " ---> Collecting the Binaries Versions
<--- "
echo "====================================================================="
echo ""
}
#flash
for i in gl5 tplifeutp1 gltutp01 glteurex
do
name=$i
case $i in
gl5)
natif="Natif Xetra"
adress="172.xx.xx.xx";;
tplifeutp1)
natif="Natif Liffe"
adress="195.xx.xx.xx";;
gltutp01)
natif="Natif Euronext"
adress="195.xx.xx.xx";;
glteurex)
natif="Natif Eurex"
adress="172.xx.xx.xx";;
*)
exit
1
esac
export name
export adress
echo "==================> $natif <=================="
echo "`date "+%Y%m%d"`"
echo "Version du SLEV5 :"
expect<< EOF
set force_conservative 1;
set timeout 30
#spawn ssh [email protected] "cat productname/log/P10_20120302.log | grep '## Version :' | tail -1"
spawn ssh $name@$adress "cat productname01/log/P10_`date "+%Y%m%d"`.log | grep '## Version :' | tail -1"
#expect "password:\r"
expect "$name@$adress's password:\r"
send -- "password\r"
#expect -gl "\\\[*]*"
#puts "\n"
send_user "...... Waiting ......"
#puts "\n"
expect eof;
EOF
#echo ""
#sleep 30
echo "Version du SELV5 :"
expect<< EOF
set force_conservative 1;
set timeout 30
spawn ssh $name@$adress "cat productname02/log/selv5_`date "+%Y%m%d"`.log | grep '## version:' | tail -1"
#expect "password:\r"
expect "$name@$adress's password:\r"
send -- "password\r"
#expect -gl "\\\[*]*"
#puts "\n"
send_user "...... Waiting ......"
#puts "\n"
expect eof;
EOF
#echo ""
#sleep 30
echo "Version du GLTS :"
expect<< EOF
set force_conservative 1;
set timeout 60
spawn ssh $name@$adress "cat productname03/log/glts_`date "+%Y%m%d"`.log | grep '## version:' | tail -1"
#expect "password:\r"
expect "$name@$adress's password:\r"
send -- "password\r"
#expect -gl "\\\[*]*"
#puts "\n"
send_user "...... Waiting ......"
#puts "\n"
expect eof;
EOF
#echo ""
done
exit
wissem.jimdo.com
Wissem Mediouni Web Site
