6 # -o pipefail: Fail on errors in scripts this calls, give stacktrace
9 # Remove opendaylight if already installed
10 if rpm -q opendaylight > /dev/null;
12 sudo yum remove -y opendaylight;
15 # Install ODL from .rpm link or .repo url
16 if [[ $URL == *.rpm ]]
18 sudo yum install -y "$URL"
19 elif [[ $URL == *.repo ]]
21 # shellcheck disable=SC2154
22 repo_file="${{URL##*/}}"
23 sudo curl --silent -o /etc/yum.repos.d/"$repo_file" "$URL"
24 sudo yum install -y opendaylight
26 echo "URL is not a link to .rpm or .repo"
29 # Install expect to interact with karaf shell
30 sudo yum install -y expect
33 sudo systemctl start opendaylight
35 # Check status of OpenDaylight
36 sudo systemctl status opendaylight
38 # Get process id of Java