6 # -o pipefail: Fail on errors in scripts this calls, give stacktrace
9 # Wait for any background apt processes to finish
10 # There seems to be a backgroud apt process that locks /var/lib/dpkg/lock
11 # and causes our apt commands to fail.
12 while pgrep apt > /dev/null; do sleep 1; done
14 # Install ODL from .deb link or .repo url
15 if [[ $PACKAGE == *.deb ]]
17 # shellcheck disable=SC2154
18 pkg_basename="${{PACKAGE##*/}}"
19 # NB: Apt can't install directly from URL, so need this intermediary file
20 curl -L --silent -o "$pkg_basename" "$PACKAGE"
21 sudo dpkg --install ./"$pkg_basename"
22 elif [[ $PACKAGE == ppa:* ]]
24 sudo add-apt-repository "$PACKAGE"
26 sudo apt-get install -y opendaylight
28 echo "URL is not a link to a PPA repo or .deb"