6 # -o pipefail: Fail on errors in scripts this calls, give stacktrace
9 # Update mirror list to avoid slow/hung one
10 sudo yum update -y yum-plugin-fastestmirror
12 # Install ODL from RPM path, RPM URL or .repo file url
13 # NB: Paths must be anchored at root
14 if [[ $URL == /* ]]; then
15 # If path is globbed (/path/to/*.rpm), expand it
16 path=$(sudo find / -wholename $URL)
17 sudo yum install -y "$path"
18 elif [[ $URL == *.rpm ]]; then
19 sudo yum install -y "$URL"
20 elif [[ $URL == *.repo ]]; then
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"