Merge pull request #1 from philclifford/takov-phil-work
Possible fix for ubuntus link checking
This commit is contained in:
commit
918d8cab1d
63
quickget
63
quickget
@ -156,24 +156,47 @@ function list_csv() {
|
||||
exit 0
|
||||
}
|
||||
function check_links() {
|
||||
local OSORUBUNTU
|
||||
local CHECK_LINKS=true
|
||||
for OS in $(os_support); do
|
||||
if [[ "${OS}" == *"ubuntu"* ]] || [[ "${OS}" == *"windows"* ]] || [[ "${OS}" == *"macos"* ]]; then
|
||||
if \
|
||||
[[ "${OS}" == *"windows"* ]] || \
|
||||
[[ "${OS}" == *"macos"* ]] || \
|
||||
[[ ! "${OS}" == *"${1:${OS}}"* ]]; then
|
||||
continue
|
||||
else
|
||||
FUNC="${OS}"
|
||||
if [[ "${OS}" == *"ubuntu"* ]]; then
|
||||
OSORUBUNTU="ubuntu"
|
||||
else
|
||||
OSORUBUNTU="${OS}"
|
||||
fi
|
||||
for RELEASE in $("releases_${FUNC}"); do
|
||||
fi
|
||||
for RELEASE in $("releases_${OSORUBUNTU}"); do
|
||||
if [[ ${RELEASE} == "eol-"* ]]; then
|
||||
continue
|
||||
else
|
||||
if [[ $(type -t "editions_${FUNC}") == function ]]; then
|
||||
for EDITY in $("editions_${FUNC}"); do
|
||||
URL=$(get_"${FUNC}" | cut -d " " -f1)
|
||||
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}")
|
||||
if [[ -n "${ZCHECK}" ]] ; then
|
||||
ZCHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}.zsync")
|
||||
echo "$FUNC $RELEASE $EDITY ${ZCHECK} ${URL}.zsync"
|
||||
fi
|
||||
echo "$FUNC $RELEASE $EDITY ${CHECK} $URL"
|
||||
|
||||
done
|
||||
else
|
||||
URL=$(get_"${FUNC}" | cut -d " " -f1)
|
||||
URL=$(get_"${OSORUBUNTU}" | cut -d " " -f1)
|
||||
CHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}")
|
||||
if [[ -n "${ZCHECK}" ]] ; then
|
||||
ZCHECK=$(curl -o /dev/null --silent --head -L --write-out '%{http_code}\t%{content_type}' "${URL}.zsync")
|
||||
echo "$FUNC $RELEASE $EDITY ${ZCHECK} ${URL}.zsync"
|
||||
fi
|
||||
echo "$FUNC $RELEASE ${CHECK} $URL"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
exit 0
|
||||
@ -332,7 +355,6 @@ function editions_garuda() {
|
||||
mate \
|
||||
qtile \
|
||||
sway \
|
||||
wayfire \
|
||||
xfce
|
||||
}
|
||||
|
||||
@ -469,10 +491,19 @@ function releases_tails() {
|
||||
}
|
||||
|
||||
function releases_ubuntu() {
|
||||
echo 14.04 \
|
||||
16.04 \
|
||||
18.04 \
|
||||
20.04 \
|
||||
local LTS_SUPPORT="14.04 16.04 18.04 20.04"
|
||||
case "${OS}" in
|
||||
kubuntu|lubuntu|ubuntukylin|\
|
||||
ubuntu-mate|ubuntustudio|xubuntu)
|
||||
## after 14.04
|
||||
LTS_SUPPORT="${LTS_SUPPORT/14.04 /}"
|
||||
;;
|
||||
ubuntu-budgie)
|
||||
#after 16.04
|
||||
LTS_SUPPORT="${LTS_SUPPORT/14.04 16.04 /}"
|
||||
;;
|
||||
esac
|
||||
echo ${LTS_SUPPORT} \
|
||||
21.10 \
|
||||
daily-live \
|
||||
daily-canary \
|
||||
@ -594,7 +625,7 @@ function check_hash() {
|
||||
|
||||
echo -n "Checking ${iso} with ${hash_algo}... "
|
||||
if ! echo "${hash} ${iso}" | ${hash_algo} --check --status; then
|
||||
echo "ERROR!"
|
||||
echo "ERROR! Checking ISO"
|
||||
echo "${iso} doesn't match ${hash}. Try running 'quickget' again."
|
||||
exit 1
|
||||
else
|
||||
@ -945,7 +976,11 @@ function get_garuda() {
|
||||
cinnamon|mate) URL="http://mirrors.fossho.st/garuda/iso/community/${EDITION}/${RELEASE}";;
|
||||
*) URL="http://mirrors.fossho.st/garuda/iso/garuda/${EDITION}/${RELEASE}";;
|
||||
esac
|
||||
ISO="garuda-${EDITION}-linux-zen-${RELEASE}.iso"
|
||||
case ${EDITION} in
|
||||
xfce|kde-barebones) ISO="garuda-${EDITION}-linux-lts-${RELEASE}.iso";;
|
||||
*) ISO="garuda-${EDITION}-linux-zen-${RELEASE}.iso";;
|
||||
esac
|
||||
|
||||
HASH="$(wget -q -O- "${URL}/${ISO}.sha256" | cut -d' ' -f1)"
|
||||
echo "${URL}/${ISO} ${HASH}"
|
||||
}
|
||||
@ -1289,7 +1324,10 @@ function get_ubuntu() {
|
||||
ISO=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f3)
|
||||
HASH=$(wget -q -O- "${URL}/MD5SUMS" | grep 'desktop\|dvd\|install' | grep amd64 | cut -d' ' -f1)
|
||||
fi
|
||||
#echo "${URL}/${ISO} ${HASH}"
|
||||
|
||||
if [[ -n "${CHECK_LINKS}" ]] ; then
|
||||
echo "${URL}/${ISO} ${HASH}"
|
||||
else
|
||||
|
||||
if [[ "${RELEASE}" == *"daily"* ]] || [ "${RELEASE}" == "dvd" ]; then
|
||||
zsync_get "${URL}/${ISO}" "${VM_PATH}" "${OS}-devel.iso"
|
||||
@ -1299,6 +1337,7 @@ function get_ubuntu() {
|
||||
check_hash "${ISO}" "${HASH}"
|
||||
make_vm_config "${ISO}"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function get_void() {
|
||||
@ -1752,7 +1791,7 @@ if [ -n "${1}" ]; then
|
||||
elif [ "${OS}" == "list_json" ]; then
|
||||
list_json
|
||||
elif [ "${OS}" == "check_links" ]; then
|
||||
check_links
|
||||
check_links "${2:-}"
|
||||
elif [ "${OS}" == "--version" ] || [ "${OS}" == "-version" ] || [ "${OS}" == "version" ]; then
|
||||
WHERE=$(dirname "${BASH_SOURCE[0]}")
|
||||
"${WHERE}/quickemu" --version
|
||||
|
Loading…
Reference in New Issue
Block a user