#!/bin/bash

#####################################################
# Script to install a minimal Ubuntu Desktop for DBVM
#####################################################

echo
echo "(Updating Ubuntu)"
apt-get -y update > vm_setup.out 2>&1
if [ $? -ne 0 ]; then (echo "Error encountered; exiting..."; exit 1); fi
apt-get -y upgrade >> vm_setup.out 2>&1
if [ $? -ne 0 ]; then (echo "Error encountered; exiting..."; exit 1); fi

echo
echo "(Installing DBVM required packages)"
apt-get -y install firefox imagemagick lftp zip \
  tcsh ncftp wget ssh cvs rsync ksh libxp6 gawk ftp bc \
  >> vm_setup.out 2>&1
if [ $? -ne 0 ]; then (echo "Error encountered; exiting..."; exit 1); fi

echo
echo "(Cleaning up)"
apt-get -y clean >> vm_setup.out 2>&1
if [ $? -ne 0 ]; then (echo "Error encountered; exiting..."; exit 1); fi

echo
echo "Done setting up Ubuntu Virtual Machine"
