~bladernr/maas-cert-server/foo

« back to all changes in this revision

Viewing changes to setup.sh

  • Committer: Jeff Lane
  • Date: 2014-03-27 21:08:50 UTC
  • Revision ID: jeffrey.lane@canonical.com-20140327210850-xv3gyug1omm3nect

* Initial release. Added files from work on project to create maas server for
certification purposes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash -e
 
2
 
 
3
# install the right packages
 
4
 
 
5
function install_package {
 
6
    echo "Attempting to install $1"
 
7
    sudo apt-get install -y $dep
 
8
    echo "Attempt complete."
 
9
    }
 
10
 
 
11
echo "Checking for required packages..."
 
12
 
 
13
for dep in "apt-mirror" "zsync"; do
 
14
    if dpkg-query -s $dep 2>/dev/null |grep Status: |grep -q installed; then
 
15
        echo "$dep is installed..."
 
16
    else
 
17
        echo "$dep is not installed..."
 
18
        install_package $dep
 
19
    fi
 
20
done