aboutsummaryrefslogtreecommitdiff
path: root/bin/base_box_optimizations.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/base_box_optimizations.sh')
-rw-r--r--bin/base_box_optimizations.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/base_box_optimizations.sh b/bin/base_box_optimizations.sh
new file mode 100644
index 0000000..0d595cb
--- /dev/null
+++ b/bin/base_box_optimizations.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+# Exit the script if the executor is not root
+if [[ $EUID -ne 0 ]]; then
+ cat <<END
+you need to run this script as root
+use :privileged => true in Vagrantfile
+END
+
+ exit 0
+fi
+
+# Optimize APT sources for fastest mirror
+perl -pi -e 's@^\s*(deb(\-src)?)\s+http://us.archive.*?\s+@\1 mirror://mirrors.ubuntu.com/mirrors.txt @g' /etc/apt/sources.list
+
+# Update repositories
+apt-get update