Skip to content

Instantly share code, notes, and snippets.

@torokmark
Last active May 24, 2019 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save torokmark/007b07decaae45d0a3db0a2e4d54dd65 to your computer and use it in GitHub Desktop.
Save torokmark/007b07decaae45d0a3db0a2e4d54dd65 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
sudo apt install python -y
yes '' | sudo apt-add-repository ppa:ansible/ansible
sudo apt update
sudo apt install ansible -y
sudo apt install git -y
echo 'Add repo name'
read REPO
echo 'Add name'
read NAME
if [[ -d "$HOME"/repo ]]; then
read -p "Are you sure? " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]; then
# do dangerous stuff
rm -rf "$HOME"/repo
git clone https://github.com/"$NAME"/"$REPO" "$HOME"/repo
fi
else
git clone https://github.com/"$NAME"/"$REPO" "$HOME"/repo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment