I am in need of installing elasticstack on multiple systems currently and would like to invoke this via bash script. Two of the steps to installing elasticsearch is to add the GPG Key and then create a sources.list
file for the repository.
When running this manually in terminal these commands are piped as follows:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb https://artifacts.elastic.co/packages/6.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-6.x.list
when attempting to create the script for this action it seems to just hang. I am assuming that this is due to the command pipes. So my question would be how can I add these lines into a bash script so that I am able to run this without any issue?