Posts

Showing posts with the label tftp

[ Level 3 ] The script for creating virtualbox envrionment (Ubuntu 12.04) with lauch new OS image.

In my company, I need to test it when I build a new image. Therefore I have to setup my testing environment for integration test. I wrote a script to automatically setup the environment from new install Ubuntu. The steps are: 1. Download and setup tftp server. 2. Download and setup dhcp server with netboot option. 3. Install virtualbox. After that you could create a VM then choose netboot. (the first interface must connect to tap0 to get boot server information) #!/bin/bash ######## utilities ######## _getTasks() { indent="$1" cat $0 | grep '()' | grep -v "^_" | grep "^[^ ]" | cut -d'(' -f1 | sed -e "s/^/$indent/" } _showUsage() { indent=" " cat <<EOF Usage: $0 task Ex. $0 `_getTasks | head -1` tasks: ${indent}[ all ] `_getTasks "$indent"` EOF } _die() { echo "$1" exit ${2:-1} } _checkID() { uid=`id | cut -d'(' -f1 | cut -d'=' -f2` [ $uid -ne ...