Last active
June 17, 2020 18:31
-
-
Save Peleke/479929a3d2e3a21ebdca56c228f18ddd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Variables | |
LAB_ENV_DIR="$HOME/Documents/LabEnvironments" | |
SCAVENGER_DIR="$LAB_ENV_DIR/linux-scavenger" | |
VAGRANTFILE_URL="http://tinyurl.com/ycyul3wt" | |
# Create Environment & Download Vagrantfile | |
echo "Creating $SCAVENGIR_DIR and downloading Vagrantfile..." | |
mkdir -p "$SCAVENGER_DIR" && cd "$_" | |
curl -s -L -o Vagrantfile "$VAGRANTFILE_URL" | |
# Lift Machine and Install Reprovisioner | |
vagrant up | |
# Tell Students how to Connect | |
SSH_USERNAME="student" | |
SSH_HOST="192.168.0.105" # $(vagrant ssh-config | grep -i 'hostname' | awk '{print $2}' | sed 's/\s*//g') | |
PORT="22" # "$(vagrant ssh-config | grep -i 'port' | awk '{print $2}' | sed 's/\s*//g')" | |
echo "Your Scavenger Hunt environment has been installed to $(pwd)!" | |
echo -e "\nConnect via SSH by running: ssh $SSH_USERNAME@$SSH_HOST -p $PORT\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On line 10
mkdir -p $SCAVENGER_DIR && cd $_
If they have a space in their username it will fail when it expands the variables and think you are passing another argument. Fix this by quoting the arguments, i.e.:
mkdir -p "$SCAVENGER_DIR" && cd "$_"