aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/package-update/getXdsServerPackage
blob: e54d09eb6ad7e55361be6f523afb9d96c2839623 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash 

XDSSERVER="xds-server"
PACKAGE_NAME="agl-${XDSSERVER}"

#test if sudoers with NOPASSWD
sudo -l | grep NOPASSWD &> /dev/null
if [ ! $? -eq 0 ]; then
    exit 1
fi

function getUpdateDebian() {
    local policy="/tmp/policy"
    sudo apt-get update &> /dev/null
    apt-cache policy ${PACKAGE_NAME} > ${policy}
    cat $policy | grep "Installed"
    cat $policy | grep "Candidate"
    rm -f $policy
}

if [ -f /etc/os-release ]; then
    source /etc/os-release
fi

case $ID in
    "debian")
        getUpdateDebian;;
    *)
	exit 1;;
esac