Skip to content

Instantly share code, notes, and snippets.

@velenux
Created March 15, 2018 16:39
Show Gist options
  • Save velenux/a254287976f32d24ec0467b8eacb3fda to your computer and use it in GitHub Desktop.
Save velenux/a254287976f32d24ec0467b8eacb3fda to your computer and use it in GitHub Desktop.
download crmsh packages
#!/bin/bash
# for some reason, this repo is having problems with yum
base_url="https://download.opensuse.org/repositories/network:/ha-clustering:/Stable/CentOS_CentOS-7/noarch/"
file_tmp=$(mktemp)
/usr/bin/curl -sS -Lo "$file_tmp" "$base_url"
if [ "x$?" != "x0" ]; then
echo "Error while opening the download page"
exit 1
fi
for pkg in crmsh crmsh-scripts python-parallax ; do
package=$(grep "a href=\"$pkg" "$file_tmp" | head -n1 | cut -d\" -f4)
/usr/bin/curl -LO -sS "${base_url}${package}"
done
rm -f "$file_tmp"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment