Results 1 to 1 of 1
Hi
I am trying to automate the install of VMware-server-1.0.4 on a FC8. Below is my script.
#!/bin/bash
vmlocation="/home/vmware"
default_port=902
curdir=`pwd`
key="99NAW-YUNFE-20137-40Q8J"
echo "Checking if you have the proper kernel ...
- 07-29-2008 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 2
Problem in Automating VMware-server installation using "expect"
Hi
I am trying to automate the install of VMware-server-1.0.4 on a FC8. Below is my script.
#!/bin/bash
vmlocation="/home/vmware"
default_port=902
curdir=`pwd`
key="99NAW-YUNFE-20137-40Q8J"
echo "Checking if you have the proper kernel and kernel-devel packages installed...."
kernel_version=`rpm -qa | grep kernel-2 | awk -F- '{print $2 "-" $3 }'`
echo "kernel installed is :`rpm -qa | grep kernel-2`"
kernel_devel=`rpm -qa | grep kernel-devel`
if [ ! -z $kernel_devel ]
then
echo "kernel-devel installed is:`rpm -qa | grep kernel-devel-$kernel_version`"
else
echo "kernel-devel-$kernel_version.i586.rpm is not installed. Installing the package, Please wait...."
rpm -ivh /tmp/vmware_install_tools/kernel-devel-$kernel_version.i586.rpm
echo "kernel-devel-$kernel_version.i586.rpm installation completed."
fi
kernel_devel_version=`rpm -qa | grep kernel-devel-$kernel_version | awk -F- '{print $3 "-" $4}'`
if [ ! -f /usr/bin/expect ]
then
echo "expect not installed. Installing the package, Please wait....."
rpm -ivh /tmp/vmware_install_tools/expect-5.43.0-9.fc8.i386.rpm
rpm -ivh /tmp/vmware_install_tools/expectk-5.43.0-9.fc8.i386.rpm
echo "expect installation completed."
fi
cd /tmp/vmware_install_tools
echo "Changed directory"
echo "Calling vmware-config.pl to configure VMware Server............"
/usr/bin/expect << EOF
spawn ./runme.pl
expect "yes] "
send "yes\r"
expect "yes]"
send "yes\r"
expect "yes]"
send "yes\r"
expect "it."
send "\r"
send "q"
expect "yes/no)"
send "yes\r"
expect "/usr/share/icons]"
send "/usr/share/icons\r"
expect "/usr/share/applications]"
send "/usr/share/applications\r"
expect "/usr/share/pixmaps]"
send "/usr/share/pixmaps\r"
expect "yes]"
send "yes\r"
expect "/lib/modules/$kernel_devel_version/build/include]"
send "/lib/modules/$kernel_devel_version/build/include\r"
expect "yes]"
send "\r"
expect "eth0]"
send "eth0\r"
expect "no]"
send "no\r"
expect "yes]"
send "no\r"
expect "no]"
send "no\r"
expect "902]" { send "902\r" } \
"904]" { send "902\r"}
expect "yes]"
send "yes\r"
expect "Machines]"
send "$vmlocation\r"
expect "yes]"
send "yes\r"
expect "no]"
send "yes\r"
expect "cancel: "
send "9C00T-YK4FX-28097-4023R\r"
EOF
cd $curdir
I have my installation files of VMware-server under /tmp/vmware_install_tools/
I used the vmware-any-any patch to install coz installing it without the patch was a real pain as it wont work on most of the machines.
My problem is the expect script runs for the all of the script except the last expect-read. When I am supposed to enter the key the expect just waits for some pattern which doesnt gets matched with "cancel:"
It waits for an input at the prompt.
Do you want to enter a serial number now? (yes/no/help) [no] yes
Please enter your 20-character serial number.
Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:
While I have tried every possible combination expect still times out and my vmware configuration is abrubtly ended.
Do you have any kind of solution to this problem. Please let me know.
Regards,
Abhijeet


Reply With Quote