#!/bin/bash
expect -c "
 	expect \"]#\"
 	send \"yum -y install rpcbind \r\"
 	set timeout 30
    expect *[y/N]* { send y\r }
 	set timeout 30
    expect *[y/N]* { send y\r }
expect eof;"
#
expect -c "
	expect \"]#\"
 	send \"yum install nfs-utils\r\"
 	set timeout 30
    expect *[y/N]* { send y\r }
 	set timeout 30
    expect *[y/N]* { send y\r }
expect eof;"

expect -c "
	expect \"]#\"
 	    send \"/etc/init.d/rpcbind restart\r\"
 	    set timeout -1
	expect \"]#\"
	    send \"/etc/init.d/nfs restart\r\"
 	    set timeout -1
 	expect \"]#\"
	    send \"chkconfig nfs on\r\"
 	    set timeout -1
 	expect \"]#\"
	    send \"chkconfig rpcbind on\r\"
 	    set timeout -1
expect eof;"

#yum -y install rpcbind
#yum -y install nfs-utils
#/etc/init.d/rpcbind start
#/etc/init.d/nfs start
#/etc/init.d/rpcbind restart
#/etc/init.d/nfs restart
#chkconfig nfs on