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 [[ $URL == *.deb ]]
17 sudo apt-get install -y "$URL"
18 elif [[ $URL == ppa:* ]]
20 sudo add-apt-repository "$REPO_FILE"
22 sudo apt-get install -y opendaylight
24 echo "URL is not a link to a PPA repo or .deb"
27 # Install expect to interact with karaf shell
28 sudo apt-get install -y expect
31 sudo systemctl start opendaylight
33 # Check status of OpenDaylight
34 sudo systemctl status opendaylight
36 # Get process id of Java