Remove unneeded extra EDITY variable

I put all these back to mainline and confirmed these changes were not necessary
This commit is contained in:
Phil Clifford 2022-03-02 04:51:46 +00:00
parent 75fff9a15c
commit fd3053054e

View File

@ -10,7 +10,7 @@ export LC_ALL=C
# 5. Update make_vm_config() - add any *required* new OS tweaks
# 6. Create a get_newos() function - that does something like this:
# function get_newos() {
# local EDITION=${EDITY}
# local EDITION="${1:-}"
# local HASH=""
# local ISO="newos-${RELEASE}-${EDITION}-amd64.iso"
# local URL="https://www.newos.org/download/${RELEASE}/${EDITION}"
@ -25,8 +25,6 @@ function cleanup() {
fi
}
EDITY="${1:-}"
function pretty_name() {
local SIMPLE_NAME=""
local PRETTY_NAME=""
@ -158,6 +156,7 @@ function list_csv() {
function check_links() {
local OSORUBUNTU
local CHECK_LINKS=true
local EDITION
local JSON=[]
for OS in $(os_support); do
@ -180,8 +179,8 @@ function check_links() {
echo "eol"
else
if [[ $(type -t "editions_${FUNC}") == function ]]; then
for EDITY in $("editions_${FUNC}"); do
URL=$(get_"${OSORUBUNTU}" "${EDITY}" | cut -d " " -f1)
for EDITION in $("editions_${FUNC}"); do
URL=$(get_"${OSORUBUNTU}" "${EDITION}" | cut -d " " -f1)
CHECK=$(curl --silent --head -L "${URL}" | tr -d "\r" | tac)
CODE=$(echo "${CHECK}" | grep -m1 'HTTP/' | cut -d' ' -f 2)
MIMETYPE=$(echo "${CHECK}" | grep -m1 '[cC]ontent-[tT]ype' | cut -d' ' -f 2)
@ -208,8 +207,8 @@ function check_links() {
else
STATUS="ERROR"
fi
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITY}" --arg c "${CODE}" --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITY} $COLOUR ${ZCHECK} ${URL}.zsync $NC"
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITION}" --arg c "${CODE}" --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITION} $COLOUR ${ZCHECK} ${URL}.zsync $NC"
fi
if [[ ${CODE} == *"200"* ]] && [[ ${MIMETYPE} == *"octet-stream"* || ${MIMETYPE} == *"x-iso9660-image"* || ${MIMETYPE} == *"zip"* || ${MIMETYPE} == *"nosniff"* ]] && [[ ${SIZE} -gt 10240 ]]; then
STATUS="GOOD"
@ -218,11 +217,11 @@ function check_links() {
else
STATUS="ERROR"
fi
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITY}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITY} $COLOUR ${CHECK} $URL $NC"
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITION}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITION} $COLOUR ${CHECK} $URL $NC"
done
else
EDITY=""
EDITION=""
URL=$(get_"${OSORUBUNTU}" | cut -d " " -f1)
CHECK=$(curl --silent --head -L "${URL}" | tr -d "\r" | tac)
CODE=$(echo "${CHECK}" | grep -m1 "HTTP/" | cut -d' ' -f 2)
@ -250,8 +249,8 @@ function check_links() {
else
STATUS="ERROR"
fi
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITY}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITY} $COLOUR ${ZCHECK} ${URL}.zsync $NC"
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITION}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} ${EDITION} $COLOUR ${ZCHECK} ${URL}.zsync $NC"
fi
if [[ ${CODE} == *"200"* ]] && [[ ${MIMETYPE} == *"octet-stream"* || ${MIMETYPE} == *"x-iso9660-image"* || ${MIMETYPE} == *"zip"* || ${MIMETYPE} == *"nosniff"* ]] && [[ ${SIZE} -gt 10240 ]]; then
STATUS="GOOD"
@ -260,7 +259,7 @@ function check_links() {
else
STATUS="ERROR"
fi
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITY}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
JSON=$(jq --null-input --arg f "${FUNC}" --arg r "${RELEASE}" --arg e "${EDITION}" --arg c "${CODE} " --arg m "${MIMETYPE}" --arg q "$SIZER" --arg s "$STATUS" --arg u "$URL" --argjson a "$JSON" '$a + [{"OS" : $f, "Release" : $r, "Edition" : $e, "STATUS" : $s, "URL" : $u, "SIZE" : $q, "CODE" : $c, "MIMETYPE" : $m }]')
#echo -e "${FUNC} ${RELEASE} $COLOUR ${CHECK} $URL $NC"
fi
fi
@ -876,7 +875,7 @@ EOF
}
function get_alma() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="AlmaLinux-${RELEASE}-x86_64-${EDITION}.iso"
local URL="http://lon.mirror.rackspace.com/almalinux/${RELEASE}/isos/x86_64/"
@ -901,7 +900,7 @@ function get_alpine() {
}
function get_android() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local JSON_ALL=""
@ -932,7 +931,7 @@ function get_archlinux() {
}
function get_arcolinux() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="arcolinux${EDITION:0:1}-${RELEASE}-x86_64.iso"
local URL="https://ant.seedhost.eu/arcolinux/iso/${RELEASE}"
@ -948,7 +947,7 @@ function get_cachyos() {
}
function get_debian() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="debian-live-${RELEASE}-amd64-${EDITION}.iso"
local URL=""
@ -998,7 +997,7 @@ function get_elementary() {
}
function get_fedora() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local JSON=""
@ -1045,7 +1044,7 @@ function get_freedos() {
}
function get_garuda() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local URL=""
@ -1074,7 +1073,7 @@ function get_gentoo() {
}
function get_ghostbsd() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local ISO=""
local URL="https://download.ghostbsd.org/releases/amd64/${RELEASE}"
local HASH=""
@ -1088,7 +1087,7 @@ function get_ghostbsd() {
}
function get_haiku() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local ISO="haiku-${RELEASE}-${EDITION}-anyboot.iso"
local URL="https://cdn.haiku-os.org/haiku-release/${RELEASE}"
local HASH=""
@ -1125,7 +1124,7 @@ function get_kolibrios() {
}
function get_linuxmint() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="linuxmint-${RELEASE}-${EDITION}-64bit.iso"
local URL="https://mirror.bytemark.co.uk/linuxmint/stable/${RELEASE}"
@ -1219,7 +1218,7 @@ function get_manjaro() {
}
function get_mxlinux() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local URL="https://sourceforge.net/projects/mx-linux/files/Final/${EDITION}"
@ -1250,7 +1249,7 @@ function get_netbsd() {
}
function get_nixos() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="latest-nixos-${EDITION}-x86_64-linux.iso"
local URL="https://channels.nixos.org/nixos-${RELEASE}"
@ -1305,7 +1304,7 @@ function get_oraclelinux() {
}
function get_popos() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local URL=""
@ -1315,7 +1314,7 @@ function get_popos() {
}
function get_regolith() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="Regolith_${EDITION}_${RELEASE}.iso"
local URL=""
@ -1329,7 +1328,7 @@ function get_regolith() {
}
function get_rockylinux() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="Rocky-${RELEASE}-x86_64-${EDITION}.iso"
local URL=""
@ -1351,7 +1350,7 @@ function get_slackware() {
}
function get_solus() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO="Solus-${RELEASE}-${EDITION}.iso"
local URL="https://mirrors.rit.edu/solus/images/${RELEASE}"
@ -1421,7 +1420,7 @@ function get_ubuntu() {
function get_void() {
local DATE=""
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local URL="https://alpha.de.repo.voidlinux.org/live/current"
@ -1438,7 +1437,7 @@ function get_void() {
}
function get_zorin() {
local EDITION=${EDITY}
local EDITION="${1:-}"
local HASH=""
local ISO=""
local URL=""