arc: add arcnic "auto" selection

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-22 16:33:43 +02:00
parent 3e6a7c5070
commit 9ecf811587
4 changed files with 190 additions and 71 deletions

View File

@ -797,7 +797,11 @@ function updateMenu() {
opts=$(cat ${TMP_PATH}/opts)
[ -z "${opts}" ] && return 1
if [ ${opts} -eq 1 ]; then
TAG="$(curl --interface ${ARCNIC} -m 5 -w "%{http_code}" -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
if [ "${ARCNIC}" == "auto" ]; then
TAG="$(curl -m 5 -w "%{http_code}" -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
else
TAG="$(curl --interface ${ARCNIC} -m 5 -w "%{http_code}" -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)"
fi
if [ $? -ne 0 ] || [ ${STATUS} -ne 200 ] || [ -z "${TAG}" ]; then
dialog --backtitle "$(backtitle)" --title "Upgrade Loader" --aspect 18 \
--msgbox "Error checking new Version!" 0 0
@ -819,11 +823,19 @@ function updateMenu() {
fi
(
# Download update file
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/arc-${TAG}.img.zip" -o "${TMP_PATH}/arc-${TAG}.img.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
fi
if [ -f "${TMP_PATH}/arc-${TAG}.img.zip" ]; then
echo "Downloading Updatefile successful!"
else
@ -1908,10 +1920,12 @@ function decryptMenu() {
###############################################################################
# ArcNIC Menu
function arcNIC () {
ARCNIC="$(readConfigKey "arc.nic" "${USER_CONFIG_FILE}")"
ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list
rm -f "${TMP_PATH}/opts" >/dev/null
touch "${TMP_PATH}/opts"
ETHX="$(ls /sys/class/net/ 2>/dev/null | grep eth)" # real network cards list
# Get actual IP
echo -e "auto \"Automated\"" >>"${TMP_PATH}/opts"
# Get NICs
for ETH in ${ETHX}; do
DRIVER="$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')"
echo -e "${ETH} \"${DRIVER}\"" >>"${TMP_PATH}/opts"

View File

@ -41,29 +41,34 @@ BUS=$(getBus "${LOADER_DISK}")
# Offline Mode check
CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")"
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) # real network cards list
for ETH in ${ETHX}; do
# Update Check
NEWTAG=$(curl --interface ${ETH} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ -n "${NEWTAG}" ]; then
ARCNIC=${ETH}
break
NEWTAG=$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ -z "${NEWTAG}" ]; then
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) # real network cards list
for ETH in ${ETHX}; do
# Update Check
NEWTAG=$(curl --interface ${ETH} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ -n "${NEWTAG}" ]; then
ARCNIC=${ETH}
break
fi
done
[ -z "${NEWTAG}" ] && NEWTAG="${ARC_VERSION}"
if [ -n "${ARCNIC}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
elif [ -z "${ARCNIC}" ] && [ "${CUSTOM}" == "false" ]; then
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
cp -f "${PART3_PATH}/configs/offline.json" "${ARC_PATH}/include/offline.json"
ARCNIC="offline"
dialog --backtitle "$(backtitle)" --title "Online Check" \
--msgbox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0
elif [ -z "${ARCNIC}" ] && [ "${CUSTOM}" == "true" ]; then
dialog --backtitle "$(backtitle)" --title "Online Check" \
--infobox "Could not connect to Github.\nReboot to try again!" 0 0
sleep 5
exec reboot
fi
done
[ -z "${NEWTAG}" ] && NEWTAG="${ARC_VERSION}"
if [ -n "${ARCNIC}" ]; then
writeConfigKey "arc.offline" "false" "${USER_CONFIG_FILE}"
elif [ -z "${ARCNIC}" ] && [ "${CUSTOM}" == "false" ]; then
writeConfigKey "arc.offline" "true" "${USER_CONFIG_FILE}"
cp -f "${PART3_PATH}/configs/offline.json" "${ARC_PATH}/include/offline.json"
ARCNIC="eth99"
dialog --backtitle "$(backtitle)" --title "Online Check" \
--msgbox "Could not connect to Github.\nSwitch to Offline Mode!" 0 0
elif [ -z "${ARCNIC}" ] && [ "${CUSTOM}" == "true" ]; then
dialog --backtitle "$(backtitle)" --title "Online Check" \
--infobox "Could not connect to Github.\nReboot to try again!" 0 0
sleep 5
exec reboot
else
ARCNIC="auto"
fi
writeConfigKey "arc.nic" "${ARCNIC}" "${USER_CONFIG_FILE}"
ARCNIC="$(readConfigKey "arc.nic" "${USER_CONFIG_FILE}")"
@ -113,9 +118,15 @@ KEYMAP="$(readConfigKey "keymap" "${USER_CONFIG_FILE}")"
if [ "${OFFLINE}" == "false" ]; then
# Timezone
GETREGION=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)
GETTIMEZONE=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)
GETKEYMAP=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')
if [ "${ARCNIC}" == "auto" ]; then
GETREGION=$(curl -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)
GETTIMEZONE=$(curl -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)
GETKEYMAP=$(curl -m 5 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')
else
GETREGION=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f1)
GETTIMEZONE=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=timezone" 2>/dev/null | tr -d '\n' | cut -d '/' -f2)
GETKEYMAP=$(curl --interface ${ARCNIC} -m 5 -v "http://ip-api.com/line?fields=countryCode" 2>/dev/null | tr '[:upper:]' '[:lower:]')
fi
writeConfigKey "time.region" "${GETREGION}" "${USER_CONFIG_FILE}"
writeConfigKey "time.timezone" "${GETTIMEZONE}" "${USER_CONFIG_FILE}"
[ -z "{KEYMAP}" ] && writeConfigKey "keymap" "${GETKEYMAP}" "${USER_CONFIG_FILE}"
@ -529,24 +540,24 @@ function arcSettings() {
if [ "${PLATFORM}" != "epyc7002" ]; then
if [ "${DT}" == "true" ] && [ "${EXTERNALCONTROLLER}" == "true" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model.\nThis is still an experimental Feature." 0 0
--msgbox "WARN: You use a HBA/Raid Controller and selected a DT Model. This is still an experimental." 5 90
fi
fi
# Check for more then 8 Ethernet Ports
DEVICENIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
if [ ${DEVICENIC} -gt 8 ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: You have more then 8 Ethernet Ports.\nThere are only 8 supported by DSM." 0 0
--msgbox "WARN: You have more then 8 Ethernet Ports. There are only 8 supported by DSM." 5 90
fi
# Check for AES
if [ "${AESSYS}" == "false" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: Your System doesn't have AES Support for Hardwareencryption in DSM." 0 0
--msgbox "WARN: Your System doesn't have AES Support for Hardwareencryption in DSM." 5 90
fi
# Check for ACPI
if [ "${ACPISYS}" == "false" ]; then
dialog --backtitle "$(backtitle)" --title "Arc Warning" \
--msgbox "WARN: Your System doesn't have ACPI Support for CPU Frequency Scaling in DSM." 0 0
--msgbox "WARN: Your System doesn't have ACPI Support for CPU Frequency Scaling in DSM." 5 90
fi
fi
EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")"
@ -683,7 +694,11 @@ function make() {
--infobox "Get PAT Data from Syno..." 3 30
idx=0
while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break
PAT_DATA=$(curl --interface ${ARCNIC} -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}")
if [ "${ARCNIC}" == "auto" ]; then
PAT_DATA=$(curl -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}")
else
PAT_DATA=$(curl --interface ${ARCNIC} -skL -m 10 "https://www.synology.com/api/support/findDownloadInfo?lang=en-us&product=${MODEL/+/%2B}&major=${PRODUCTVER%%.*}&minor=${PRODUCTVER##*.}")
fi
if [ "$(echo ${PAT_DATA} | jq -r '.success' 2>/dev/null)" == "true" ]; then
if echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].label_ext' 2>/dev/null | grep -q 'pat'; then
PAT_URL=$(echo ${PAT_DATA} | jq -r '.info.system.detail[0].items[0].files[0].url')
@ -705,8 +720,13 @@ function make() {
--infobox "Get PAT Data from Github..." 3 30
idx=0
while [ ${idx} -le 3 ]; do # Loop 3 times, if successful, break
PAT_URL=$(curl --interface ${ARCNIC} -m 10 -skL "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_url")
PAT_HASH=$(curl --interface ${ARCNIC} -m 10 -skL "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_hash")
if [ "${ARCNIC}" == "auto" ]; then
PAT_URL=$(curl -skL -m 10 "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_url")
PAT_HASH=$(curl -skL -m 10 "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_hash")
else
PAT_URL=$(curl --interface ${ARCNIC} -m 10 -skL "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_url")
PAT_HASH=$(curl --interface ${ARCNIC} -m 10 -skL "https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/dsm/${MODEL/+/%2B}/${PRODUCTVER}/pat_hash")
fi
PAT_URL=${PAT_URL%%\?*}
if [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ]; then
if echo "${PAT_URL}" | grep -q "https://"; then
@ -746,7 +766,9 @@ function make() {
# Get new Files
DSM_FILE="${UNTAR_PAT_PATH}/${PAT_HASH}.tar"
DSM_URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/files/${MODEL/+/%2B}/${PRODUCTVER}/${PAT_HASH}.tar"
if curl --interface ${ARCNIC} -skL "${DSM_URL}" -o "${DSM_FILE}"; then
if curl -skL "${DSM_URL}" -o "${DSM_FILE}"; then
VALID="true"
elif curl --interface ${ARCNIC} -skL "${DSM_URL}" -o "${DSM_FILE}"; then
VALID="true"
else
dialog --backtitle "$(backtitle)" --title "DSM Download" --aspect 18 \
@ -754,7 +776,9 @@ function make() {
sleep 5
# Grep PAT_URL
PAT_FILE="${TMP_PATH}/${PAT_HASH}.pat"
if curl --interface ${ARCNIC} -skL "${PAT_URL}" -o "${PAT_FILE}"; then
if curl -skL "${DSM_URL}" -o "${DSM_FILE}"; then
VALID="true"
elif curl --interface ${ARCNIC} -skL "${DSM_URL}" -o "${DSM_FILE}"; then
VALID="true"
else
dialog --backtitle "$(backtitle)" --title "DSM Download" --aspect 18 \

View File

@ -152,6 +152,10 @@ fi
if echo "purley broadwellnkv2" | grep -wq "${PLATFORM}"; then
CMDLINE["SASmodel"]="1"
fi
if echo "broadwell broadwellnk" | grep -wq "${PLATFORM}"; then
[ "${CMDLINE['modprobe.blacklist']}" != "" ] && CMDLINE['modprobe.blacklist']+=","
CMDLINE['modprobe.blacklist']+="mpt2sas"
fi
# Cmdline NIC Settings
NIC=0

View File

@ -12,7 +12,11 @@ function updateLoader() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -30,12 +34,21 @@ function updateLoader() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/update.zip" -o "${TMP_PATH}/update.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/update.zip" -o "${TMP_PATH}/update.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
done
curl -skL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/update.zip" -o "${TMP_PATH}/update.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/update.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
echo "Download successful!"
unzip -oq "${TMP_PATH}/update.zip" -d "${TMP_PATH}"
@ -68,7 +81,11 @@ function updateAddons() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-addons/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-addons/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-addons/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -86,12 +103,21 @@ function updateAddons() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${TMP_PATH}/addons.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${TMP_PATH}/addons.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
done
curl -skL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/addons.zip" -o "${TMP_PATH}/addons.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-addons/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/addons.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
echo "Download successful!"
rm -rf "${ADDONS_PATH}"
@ -129,7 +155,11 @@ function updatePatches() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-patches/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-patches/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-patches/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -147,12 +177,21 @@ function updatePatches() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${TMP_PATH}/patches.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${TMP_PATH}/patches.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
done
curl -skL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/patches.zip" -o "${TMP_PATH}/patches.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-patches/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/patches.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
echo "Download successful!"
rm -rf "${PATCH_PATH}"
@ -182,7 +221,11 @@ function updateModules() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 10 -skL "https://api.github.com/repos/AuxXxilium/arc-modules/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -200,12 +243,21 @@ function updateModules() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${TMP_PATH}/modules.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${TMP_PATH}/modules.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
done
curl -skL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/modules.zip" -o "${TMP_PATH}/modules.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-modules/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/modules.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
echo "Download successful!"
rm -rf "${MODULES_PATH}"
@ -254,7 +306,11 @@ function updateConfigs() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-configs/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-configs/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-configs/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -272,12 +328,21 @@ function updateConfigs() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${TMP_PATH}/configs.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${TMP_PATH}/configs.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
done
curl -skL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/configs.zip" -o "${TMP_PATH}/configs.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
curl --interface ${ARCNIC} -skL "https://github.com/AuxXxilium/arc-configs/releases/download/${TAG}/checksum.sha256" -o "${TMP_PATH}/checksum.sha256"
fi
if [ "$(sha256sum "${TMP_PATH}/configs.zip" | awk '{print $1}')" = "$(cat ${TMP_PATH}/checksum.sha256 | awk '{print $1}')" ]; then
echo "Download successful!"
rm -rf "${MODEL_CONFIG_PATH}"
@ -307,7 +372,11 @@ function updateLKMs() {
# Check for new Version
idx=0
while [ ${idx} -le 5 ]; do # Loop 5 times, if successful, break
TAG=$(curl --interface ${ARCNIC} -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-lkm/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
if [ "${ARCNIC}" == "auto" ]; then
TAG=$(curl -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-lkm/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
else
TAG=$(curl --interface ${ARCNIC} -m 5 -skL "https://api.github.com/repos/AuxXxilium/arc-lkm/releases" | jq -r ".[].tag_name" | sort -rV | head -1)
fi
if [ -n "${TAG}" ]; then
echo "New Version: ${TAG}"
break
@ -325,11 +394,19 @@ function updateLKMs() {
fi
# Download update file
echo "Downloading ${TAG}"
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${TMP_PATH}/rp-lkms.zip" 2>&1 | while IFS= read -r -n1 char; do
if [ "${ARCNIC}" == "auto" ]; then
curl -#kL "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${TMP_PATH}/rp-lkms.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download:$progress" && progress="" && keep=0 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
done
else
curl --interface ${ARCNIC} -#kL "https://github.com/AuxXxilium/arc-lkm/releases/download/${TAG}/rp-lkms.zip" -o "${TMP_PATH}/rp-lkms.zip" 2>&1 | while IFS= read -r -n1 char; do
[[ $char =~ [0-9] ]] && keep=1 ;
[[ $char == % ]] && echo "Download: $progress" && progress="" && keep=0 ;
[[ $keep == 1 ]] && progress="$progress$char" ;
done
fi
if [ -f "${TMP_PATH}/rp-lkms.zip" ]; then
echo "Download successful!"
rm -rf "${LKMS_PATH}"