update xds-server package in docker
[src/xds/xds-server.git] / scripts / package-update / getXdsServerPackage
1 #!/bin/bash 
2
3 XDSSERVER="xds-server"
4 PACKAGE_NAME="agl-${XDSSERVER}"
5
6 #test if sudoers with NOPASSWD
7 sudo -l | grep NOPASSWD &> /dev/null
8 if [ ! $? -eq 0 ]; then
9     exit 1
10 fi
11
12 function getUpdateDebian() {
13     local policy="/tmp/policy"
14     sudo apt-get update &> /dev/null
15     apt-cache policy ${PACKAGE_NAME} > ${policy}
16     cat $policy | grep "Installed"
17     cat $policy | grep "Candidate"
18     rm -f $policy
19 }
20
21 if [ -f /etc/os-release ]; then
22     source /etc/os-release
23 fi
24
25 case $ID in
26     "debian")
27         getUpdateDebian;;
28     *)
29         exit 1;;
30 esac
31