Last active
September 8, 2017 16:27
-
-
Save aric49/51dc407121bdcf1840905d99989191e0 to your computer and use it in GitHub Desktop.
Bring Up an LXC Development Lab
This file contains hidden or 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
| #!/bin/bash | |
| #Starts a Development Lab using LXC Containers | |
| set -x | |
| function DevLabUp(){ | |
| echo "Bringing up the dev lab......" | |
| lxc launch ubuntu:16.04 Lab1 -c security.nesting=true -c security.privileged=true | |
| lxc launch ubuntu:16.04 Lab2 -c security.nesting=true -c security.privileged=true | |
| lxc launch ubuntu:16.04 Lab3 -c security.nesting=true -c security.privileged=true | |
| lxc launch ubuntu:16.04 Lab4 -c security.nesting=true -c security.privileged=true | |
| lxc list | |
| } | |
| function DevLabDown(){ | |
| echo "Bringing Down the Dev Lab......." | |
| lxc delete Lab1 --force | |
| lxc delete Lab2 --force | |
| lxc delete Lab3 --force | |
| lxc delete Lab4 --force | |
| lxc list | |
| echo "Lab Successfully Stopped." | |
| } | |
| #DevLabUp | |
| #DevLabDown | |
| Lab_Arg=$1 | |
| if [[ $Lab_Arg == "up" ]]; then | |
| DevLabUp | |
| elif [[ $Lab_Arg == "down" ]]; then | |
| DevLabDown | |
| else | |
| echo "I don't know what you mean" | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment