~hardware-certification/maas-cert-server/trunk

1 by Jeff Lane
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