Remove reference to Packet EBS Storage
It's deprecated now :[
This commit is contained in:
@@ -9,51 +9,6 @@ export DEBIAN_FRONTEND=noninteractive
|
|||||||
# Bypass prompt for libsslv1.1 https://unix.stackexchange.com/a/543706
|
# Bypass prompt for libsslv1.1 https://unix.stackexchange.com/a/543706
|
||||||
echo 'libssl1.1:amd64 libraries/restart-without-asking boolean true' | sudo debconf-set-selections
|
echo 'libssl1.1:amd64 libraries/restart-without-asking boolean true' | sudo debconf-set-selections
|
||||||
|
|
||||||
# Download Packet.net storage utilities
|
|
||||||
echo "[$(date +%H:%M:%S)]: Downloading Packet external storage utilities..."
|
|
||||||
wget -q -O /usr/local/bin/packet-block-storage-attach "https://raw.githubusercontent.com/packethost/packet-block-storage/master/packet-block-storage-attach"
|
|
||||||
chmod +x /usr/local/bin/packet-block-storage-attach
|
|
||||||
wget -q -O /usr/local/bin/packet-block-storage-detach "https://raw.githubusercontent.com/packethost/packet-block-storage/master/packet-block-storage-detach"
|
|
||||||
chmod +x /usr/local/bin/packet-block-storage-detach
|
|
||||||
|
|
||||||
# Set a flag to determine if the boxes are available on external Packet storage
|
|
||||||
BOXES_PRESENT=0
|
|
||||||
# Attempt to mount the block storage
|
|
||||||
echo "[$(date +%H:%M:%S)]: Attempting to mount external storage..."
|
|
||||||
/usr/local/bin/packet-block-storage-attach
|
|
||||||
sleep 10
|
|
||||||
# Check if it was successful by looking for volume* in /dev/mapper
|
|
||||||
if ls -al /dev/mapper/volume* > /dev/null 2>&1; then
|
|
||||||
echo "[$(date +%H:%M:%S)]: Mounting of external storage was successful."
|
|
||||||
sleep 5
|
|
||||||
if mount /dev/mapper/volume-fed37d73-part1 /mnt; then
|
|
||||||
echo "[$(date +%H:%M:%S)]: External storage successfully mounted to /mnt"
|
|
||||||
else
|
|
||||||
echo "[$(date +%H:%M:%S)]: Something went wrong mounting the filesystem from the external storage."
|
|
||||||
fi
|
|
||||||
if ls -al /mnt/*.box > /dev/null 2>&1; then
|
|
||||||
BOXES_PRESENT=1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[$(date +%H:%M:%S)]: No volumes found after attempting to mount storage. Trying again..."
|
|
||||||
/usr/local/bin/packet-block-storage-attach
|
|
||||||
sleep 15
|
|
||||||
if ! ls -al /dev/mapper/volume* > /dev/null 2>&1; then
|
|
||||||
echo "[$(date +%H:%M:%S)]: Failed to mount volumes even after a retry. Giving up..."
|
|
||||||
else
|
|
||||||
echo "[$(date +%H:%M:%S)]: Successfully mounted the external storage after a retry."
|
|
||||||
sleep 10
|
|
||||||
if mount /dev/mapper/volume-fed37d73-part1 /mnt; then
|
|
||||||
echo "[$(date +%H:%M:%S)]: External storage successfully mounted to /mnt"
|
|
||||||
else
|
|
||||||
echo "[$(date +%H:%M:%S)]: Something went wrong mounting the filesystem from the external storage."
|
|
||||||
fi
|
|
||||||
if ls -al /mnt/*.box > /dev/null 2>&1; then
|
|
||||||
BOXES_PRESENT=1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Disable IPv6 - may help with the vagrant-reload plugin: https://github.com/hashicorp/vagrant/issues/8795#issuecomment-468945063
|
# Disable IPv6 - may help with the vagrant-reload plugin: https://github.com/hashicorp/vagrant/issues/8795#issuecomment-468945063
|
||||||
echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf
|
echo "net.ipv6.conf.all.disable_ipv6=1" >> /etc/sysctl.conf
|
||||||
sysctl -p /etc/sysctl.conf > /dev/null
|
sysctl -p /etc/sysctl.conf > /dev/null
|
||||||
@@ -97,7 +52,6 @@ sysctl -p /etc/sysctl.conf > /dev/null
|
|||||||
## Git Clone DL (Only needed when manually building)
|
## Git Clone DL (Only needed when manually building)
|
||||||
#git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab
|
#git clone https://github.com/clong/DetectionLab.git /opt/DetectionLab
|
||||||
|
|
||||||
|
|
||||||
# Make the Vagrant instances headless
|
# Make the Vagrant instances headless
|
||||||
cd /opt/DetectionLab/Vagrant || exit 1
|
cd /opt/DetectionLab/Vagrant || exit 1
|
||||||
sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile
|
sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile
|
||||||
@@ -105,14 +59,6 @@ cd /opt/DetectionLab/Vagrant/Exchange || exit 1
|
|||||||
sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile
|
sed -i 's/vb.gui = true/vb.gui = false/g' Vagrantfile
|
||||||
cd /opt/DetectionLab/Vagrant || exit 1
|
cd /opt/DetectionLab/Vagrant || exit 1
|
||||||
|
|
||||||
# If the boxes are present on external storage, we can modify the Vagrantfile to
|
|
||||||
# point to the boxes on disk so we don't have to download them
|
|
||||||
if [ $BOXES_PRESENT -eq 1 ]; then
|
|
||||||
echo "[$(date +%H:%M:%S)]: Updating the Vagrantfile to point to the boxes mounted on external storage..."
|
|
||||||
sed -i 's#"detectionlab/win2016"#"/mnt/windows_2016_virtualbox.box"#g' /opt/DetectionLab/Vagrant/Vagrantfile
|
|
||||||
sed -i 's#"detectionlab/win10"#"/mnt/windows_10_virtualbox.box"#g' /opt/DetectionLab/Vagrant/Vagrantfile
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Recreate a barebones version of the build script so we have some sense of return codes
|
# Recreate a barebones version of the build script so we have some sense of return codes
|
||||||
cat << 'EOF' > /opt/DetectionLab/build.sh
|
cat << 'EOF' > /opt/DetectionLab/build.sh
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|||||||
Reference in New Issue
Block a user