0

Im trying to download git using a .sh file for vagrant but when it gives me the prompt to continue, it aborts automatically. This is the contents of my .sh file:

#!/usr/bin/env bash 

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git
git clone https://git.openstack.org/openstack-dev/devstack

How do I tell it to input yes at the correct time. I tried to do: echo "yes" after the install git line but that's too late

RalfFriedl
  • 8,981

1 Answers1

0

If it aborts instead of asking, the script is not connected to a terminal.

From the apt-get manual:

-y, --yes, --assume-yes
Automatic yes to prompts. Assume "yes" as answer to all prompts and run non-interactively.

RalfFriedl
  • 8,981
  • Okay. I got passed that. now im trying to run stack.sh from devstack but when I do, I get the error "cannot determine host ip address." I did try to go to the samples/local.conf file and set my HOST_IP but that didnt work either – QuestionAsker123 Aug 30 '18 at 21:07
  • @QuestionAsker123 Your script is not running stack.sh. If you have further issues that are not pure followup issues, then update your question. If this answer solves the problem as stated in the question, I suggest that you accept it. – Kusalananda Aug 31 '18 at 05:49