I'm not sure if we check for expect to be installed somewhere earlier. If we don't, here would be a good place to install it:
apt-get install -y expect
yum install -y expect