arc: more rework

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-08-29 19:38:14 +02:00
parent 87e9682a1e
commit 874d14b948
3 changed files with 99 additions and 125 deletions

View File

@ -88,7 +88,7 @@ function backtitle() {
############################################################################### ###############################################################################
# Model Selection # Model Selection
function arcModel() { function arcModel() {
CHANGED=false CHANGED="false"
dialog --backtitle "$(backtitle)" --title "DSM Model" \ dialog --backtitle "$(backtitle)" --title "DSM Model" \
--infobox "Reading Models..." 3 25 --infobox "Reading Models..." 3 25
# Loop menu # Loop menu
@ -213,14 +213,11 @@ function arcModel() {
writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}" writeConfigKey "emmcboot" "false" "${USER_CONFIG_FILE}"
writeConfigKey "hddsort" "false" "${USER_CONFIG_FILE}" writeConfigKey "hddsort" "false" "${USER_CONFIG_FILE}"
writeConfigKey "modelid" "${MODELID}" "${USER_CONFIG_FILE}" writeConfigKey "modelid" "${MODELID}" "${USER_CONFIG_FILE}"
writeConfigKey "paturl" "" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "" "${USER_CONFIG_FILE}"
writeConfigKey "platform" "${PLATFORM}" "${USER_CONFIG_FILE}" writeConfigKey "platform" "${PLATFORM}" "${USER_CONFIG_FILE}"
writeConfigKey "ramdisk-hash" "" "${USER_CONFIG_FILE}" writeConfigKey "ramdisk-hash" "" "${USER_CONFIG_FILE}"
writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}" writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "sn" "" "${USER_CONFIG_FILE}"
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}" writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
CHANGED=true CHANGED="true"
elif [ "${MODEL}" != "${resp}" ]; then elif [ "${MODEL}" != "${resp}" ]; then
PRODUCTVER="" PRODUCTVER=""
MODEL="${resp}" MODEL="${resp}"
@ -244,7 +241,7 @@ function arcModel() {
writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}" writeConfigKey "smallnum" "" "${USER_CONFIG_FILE}"
writeConfigKey "sn" "" "${USER_CONFIG_FILE}" writeConfigKey "sn" "" "${USER_CONFIG_FILE}"
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}" writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
CHANGED=true CHANGED="true"
fi fi
if [ "${CHANGED}" == "true" ]; then if [ "${CHANGED}" == "true" ]; then
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true
@ -265,14 +262,17 @@ function arcModel() {
# Arc Version Section # Arc Version Section
function arcVersion() { function arcVersion() {
# Read Model Config # Read Model Config
CHANGED=false CHANGED="false"
MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")" MODEL="$(readConfigKey "model" "${USER_CONFIG_FILE}")"
PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")" PLATFORM="$(readConfigKey "platform" "${USER_CONFIG_FILE}")"
DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")" DT="$(readConfigKey "platforms.${PLATFORM}.dt" "${P_FILE}")"
PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")" PRODUCTVER="$(readConfigKey "productver" "${USER_CONFIG_FILE}")"
AUTOMATED="$(readConfigKey "automated" "${USER_CONFIG_FILE}")" AUTOMATED="$(readConfigKey "automated" "${USER_CONFIG_FILE}")"
# Get PAT Data from Config
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
# Check for Custom Build # Check for Custom Build
if [ "${AUTOMATED}" == "false" ]; then if [ "${AUTOMATED}" == "false" ] && [ "${OFFLINE}" == "false" ]; then
# Select Build for DSM # Select Build for DSM
ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)" ITEMS="$(readConfigEntriesArray "platforms.${PLATFORM}.productvers" "${P_FILE}" | sort -r)"
dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitle)" \ dialog --clear --no-items --nocancel --title "DSM Version" --backtitle "$(backtitle)" \
@ -293,20 +293,18 @@ function arcVersion() {
writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}" writeConfigKey "zimage-hash" "" "${USER_CONFIG_FILE}"
writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.confdone" "false" "${USER_CONFIG_FILE}"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")" CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
CHANGED=true CHANGED="true"
fi fi
if [ "${CHANGED}" == "true" ]; then if [ "${CHANGED}" == "true" ]; then
rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true rm -f "${ORI_ZIMAGE_FILE}" "${ORI_RDGZ_FILE}" "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true
rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true rm -f "${PART1_PATH}/grub_cksum.syno" "${PART1_PATH}/GRUB_VER" "${PART2_PATH}/"* >/dev/null 2>&1 || true
fi fi
fi
PAT_URL="" PAT_URL=""
PAT_HASH="" PAT_HASH=""
URLVER="" URLVER=""
# Cleanup # Cleanup
[ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}" [ -d "${UNTAR_PAT_PATH}" ] && rm -rf "${UNTAR_PAT_PATH}"
mkdir -p "${UNTAR_PAT_PATH}" mkdir -p "${UNTAR_PAT_PATH}"
if [ "${OFFLINE}" == "false" ] && [ "${AUTOMATED}" == "false" ]; then
while true; do while true; do
PJ="$(python ${ARC_PATH}/include/functions.py getpats4mv -m "${MODEL}" -v "${PRODUCTVER}")" PJ="$(python ${ARC_PATH}/include/functions.py getpats4mv -m "${MODEL}" -v "${PRODUCTVER}")"
if [[ -z "${PJ}" || "${PJ}" = "{}" ]]; then if [[ -z "${PJ}" || "${PJ}" = "{}" ]]; then
@ -332,18 +330,7 @@ function arcVersion() {
[ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && break [ -n "${PAT_URL}" ] && [ -n "${PAT_HASH}" ] && break
fi fi
done done
elif [ "${OFFLINE}" == "false" ] && [ "${AUTOMATED}" == "true" ]; then if [ -z "${PAT_URL}" ] || [ -z "${PAT_HASH}" ]; then
# Get PAT Data
dialog --backtitle "$(backtitle)" --colors --title "DSM Version" \
--infobox "Get PAT Data from Local File..." 3 40
NANOVER="$(readConfigKey "nanover" "${USER_CONFIG_FILE}")"
[ -n "${NANOVER}" ] && DSMVER="${PRODUCTVER}.${NANOVER}" || DSMVER="${PRODUCTVER}"
PAT_URL="$(readConfigKey "${MODEL}.\"${DSMVER}\".url" "${D_FILE}")"
PAT_HASH="$(readConfigKey "${MODEL}.\"${DSMVER}\".hash" "${D_FILE}")"
sleep 2
# To-DO: add to custom build
fi
if [ -z "${PAT_URL}" ] && [ -z "${PAT_HASH}" ] && [ "${AUTOMATED}" == "false" ]; then
MSG="Failed to get PAT Data.\n" MSG="Failed to get PAT Data.\n"
MSG+="Please manually fill in the URL and Hash of PAT.\n" MSG+="Please manually fill in the URL and Hash of PAT.\n"
MSG+="You will find these Data at: https://auxxxilium.tech/wiki/arc-loader-arc-loader/url-hash-liste" MSG+="You will find these Data at: https://auxxxilium.tech/wiki/arc-loader-arc-loader/url-hash-liste"
@ -355,12 +342,12 @@ function arcVersion() {
return 1 # 1 or 255 # cancel-button or ESC return 1 # 1 or 255 # cancel-button or ESC
PAT_URL="$(cat "${TMP_PATH}/resp" | sed -n '1p')" PAT_URL="$(cat "${TMP_PATH}/resp" | sed -n '1p')"
PAT_HASH="$(cat "${TMP_PATH}/resp" | sed -n '2p')" PAT_HASH="$(cat "${TMP_PATH}/resp" | sed -n '2p')"
elif [ -z "${PAT_URL}" ] && [ -z "${PAT_HASH}" ] && [ "${AUTOMATED}" == "true" ]; then fi
dialog --backtitle "$(backtitle)" --colors --title "DSM Version" \ VALID="true"
--infobox "Could not get PAT Data..." 4 30 elif [ "${AUTOMATED}" == "true" ]; then
PAT_URL="#" PAT_URL="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")"
PAT_HASH="#" PAT_HASH="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
sleep 5 VALID="true"
fi fi
# Check PAT URL # Check PAT URL
if [ "${OFFLINE}" == "false" ]; then if [ "${OFFLINE}" == "false" ]; then
@ -370,10 +357,12 @@ function arcVersion() {
if echo "${URLCHECK}" | grep -q 404; then if echo "${URLCHECK}" | grep -q 404; then
VALID="false" VALID="false"
else else
VALID="true"
fi
fi
sleep 2 sleep 2
# Get PAT Data from Config DSM_FILE="${USER_UP_PATH}/${PAT_HASH}.tar"
PAT_URL_CONF="$(readConfigKey "paturl" "${USER_CONFIG_FILE}")" if [ ! -f "${DSM_FILE}" ] && && [ "${OFFLINE}" == "false" ] && [ "${VALID}" == "true" ]; then
PAT_HASH_CONF="$(readConfigKey "pathash" "${USER_CONFIG_FILE}")"
dialog --backtitle "$(backtitle)" --colors --title "DSM Version" \ dialog --backtitle "$(backtitle)" --colors --title "DSM Version" \
--infobox "Try to get DSM Image..." 3 40 --infobox "Try to get DSM Image..." 3 40
if [ "${PAT_HASH}" != "${PAT_HASH_CONF}" ] || [ "${PAT_URL}" != "${PAT_URL_CONF}" ] || [ ! -f "${ORI_ZIMAGE_FILE}" ] || [ ! -f "${ORI_RDGZ_FILE}" ]; then if [ "${PAT_HASH}" != "${PAT_HASH_CONF}" ] || [ "${PAT_URL}" != "${PAT_URL_CONF}" ] || [ ! -f "${ORI_ZIMAGE_FILE}" ] || [ ! -f "${ORI_RDGZ_FILE}" ]; then
@ -381,7 +370,6 @@ function arcVersion() {
writeConfigKey "paturl" "${PAT_URL}" "${USER_CONFIG_FILE}" writeConfigKey "paturl" "${PAT_URL}" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "${PAT_HASH}" "${USER_CONFIG_FILE}" writeConfigKey "pathash" "${PAT_HASH}" "${USER_CONFIG_FILE}"
# Get new Files # 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" DSM_URL="https://raw.githubusercontent.com/AuxXxilium/arc-dsm/main/files/${MODEL/+/%2B}/${PRODUCTVER}/${PAT_HASH}.tar"
if curl -skL "${DSM_URL}" -o "${DSM_FILE}"; then if curl -skL "${DSM_URL}" -o "${DSM_FILE}"; then
VALID="true" VALID="true"
@ -392,7 +380,7 @@ function arcVersion() {
--infobox "No DSM Image found!\nTry to get .pat from Syno." 4 40 --infobox "No DSM Image found!\nTry to get .pat from Syno." 4 40
sleep 5 sleep 5
# Grep PAT_URL # Grep PAT_URL
PAT_FILE="${TMP_PATH}/${PAT_HASH}.pat" PAT_FILE="${USER_UP_PATH}/${PAT_HASH}.pat"
if curl -skL "${PAT_URL}" -o "${PAT_FILE}"; then if curl -skL "${PAT_URL}" -o "${PAT_FILE}"; then
VALID="true" VALID="true"
elif curl --interface ${ARCNIC} -skL "${PAT_URL}" -o "${PAT_FILE}"; then elif curl --interface ${ARCNIC} -skL "${PAT_URL}" -o "${PAT_FILE}"; then
@ -404,6 +392,45 @@ function arcVersion() {
sleep 5 sleep 5
fi fi
fi fi
fi
elif [ ! -f "${DSM_FILE}" ] && [ "${OFFLINE}" == "true" ] && [ "${AUTOMATED}" == "false" ]; then
PAT_FILE=$(ls ${USER_UP_PATH}/*.pat | head -n 1)
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ]; then
rm -f "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true
VALID="true"
elif [ ! -f "${PAT_FILE}" ]; then
# Check for existing Files
mkdir -p "${USER_UP_PATH}"
# Get new Files
MSG=""
MSG+="Upload your DSM .pat File now to /tmp/upload.\n"
MSG+="You will find these Files at: https://download.synology.com\n"
MSG+="Use Webfilebrowser: ${IPCON}:7304 or SSH/SFTP to connect to ${IPCON}\n"
MSG+="User: root | Password: arc\n"
MSG+="Press OK to continue!"
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--msgbox "${MSG}" 9 80
fi
# Grep PAT_FILE
if [ -f "${PAT_FILE}" ] && [ $(wc -c "${PAT_FILE}" | awk '{print $1}') -gt 300000000 ]; then
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--infobox "DSM Image found!" 3 40
# Remove PAT Data for Offline
writeConfigKey "paturl" "#" "${USER_CONFIG_FILE}"
writeConfigKey "pathash" "#" "${USER_CONFIG_FILE}"
VALID="true"
elif [ ! -f "${PAT_FILE}" ]; then
dialog --backtitle "$(backtitle)" --title "DSM Extraction" --aspect 18 \
--infobox "No DSM Image found!\nExit." 4 40
VALID="false"
sleep 5
else
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--infobox "Incorrect DSM Image (.pat) found!\nExit." 4 40
VALID="false"
sleep 5
fi
fi
if [ -f "${DSM_FILE}" ] && [ "${VALID}" == "true" ]; then if [ -f "${DSM_FILE}" ] && [ "${VALID}" == "true" ]; then
tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null tar -xf "${DSM_FILE}" -C "${UNTAR_PAT_PATH}" 2>/dev/null
VALID="true" VALID="true"
@ -416,59 +443,6 @@ function arcVersion() {
VALID="false" VALID="false"
sleep 5 sleep 5
fi fi
fi
fi
elif [ "${OFFLINE}" == "true" ] && [ "${AUTOMATED}" == "false" ]; then
if [ -f "${ORI_ZIMAGE_FILE}" ] && [ -f "${ORI_RDGZ_FILE}" ]; then
rm -f "${MOD_ZIMAGE_FILE}" "${MOD_RDGZ_FILE}" 2>/dev/null || true
VALID="true"
else
# Check for existing Files
mkdir -p "${USER_UP_PATH}"
# Get new Files
MSG=""
MSG+="Upload your DSM .pat File now to /tmp/upload.\n"
MSG+="You will find these Files at: https://download.synology.com\n"
MSG+="Use Webfilebrowser: ${IPCON}:7304 or SSH/SFTP to connect to ${IPCON}\n"
MSG+="User: root | Password: arc\n"
MSG+="Press OK to continue!"
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--msgbox "${MSG}" 9 80
# Grep PAT_FILE
PAT_FILE=$(ls ${USER_UP_PATH}/*.pat | head -n 1)
if [ -f "${PAT_FILE}" ] && [ $(wc -c "${PAT_FILE}" | awk '{print $1}') -gt 300000000 ]; then
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--infobox "DSM Image found!" 3 40
# Remove PAT Data for Offline
[ -z "${PAT_URL}" ] && writeConfigKey "paturl" "#" "${USER_CONFIG_FILE}"
[ -z "${PAT_HASH}" ] && writeConfigKey "pathash" "#" "${USER_CONFIG_FILE}"
# Extract Files
if extractDSMFiles "${PAT_FILE}" "${UNTAR_PAT_PATH}"; then
VALID="true"
else
dialog --backtitle "$(backtitle)" --title "DSM Extraction" --aspect 18 \
--infobox "DSM Extraction failed!\nExit." 4 40
VALID="false"
sleep 5
fi
elif [ ! -f "${PAT_FILE}" ]; then
dialog --backtitle "$(backtitle)" --title "DSM Extraction" --aspect 18 \
--infobox "No DSM Image found!\nExit." 4 40
VALID="false"
sleep 5
else
dialog --backtitle "$(backtitle)" --title "DSM Upload" --aspect 18 \
--infobox "Incorrect DSM Image (.pat) found!\nExit." 4 40
VALID="false"
sleep 5
fi
fi
else
dialog --backtitle "$(backtitle)" --title "Arc Build" --aspect 18 \
--infobox "Can't build Custom Loader while Offline!\nExit." 4 40
VALID="false"
sleep 5
fi
# Copy DSM Files to Locations if DSM Files not found # Copy DSM Files to Locations if DSM Files not found
if [ ! -f "${ORI_ZIMAGE_FILE}" ] || [ ! -f "${ORI_RDGZ_FILE}" ]; then if [ ! -f "${ORI_ZIMAGE_FILE}" ] || [ ! -f "${ORI_RDGZ_FILE}" ]; then
[ "${VALID}" == "true" ] && copyDSMFiles "${UNTAR_PAT_PATH}" 2>/dev/null [ "${VALID}" == "true" ] && copyDSMFiles "${UNTAR_PAT_PATH}" 2>/dev/null
@ -527,10 +501,10 @@ function arcPatch() {
SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")" SN="$(readConfigKey "sn" "${USER_CONFIG_FILE}")"
if [ "${AUTOMATED}" == "true" ] && [ -z "${SN}" ]; then if [ "${AUTOMATED}" == "true" ] && [ -z "${SN}" ]; then
if [ -n "${ARCCONF}" ]; then if [ -n "${ARCCONF}" ]; then
SN=$(generateSerial "${MODEL}" true) SN=$(generateSerial "${MODEL}" "true")
writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}"
else else
SN=$(generateSerial "${MODEL}" false) SN=$(generateSerial "${MODEL}" "false")
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
fi fi
elif [ "${AUTOMATED}" == "false" ]; then elif [ "${AUTOMATED}" == "false" ]; then
@ -546,11 +520,11 @@ function arcPatch() {
[ -z "${resp}" ] && return 1 [ -z "${resp}" ] && return 1
if [ ${resp} -eq 1 ]; then if [ ${resp} -eq 1 ]; then
# Read Arc Patch from File # Read Arc Patch from File
SN=$(generateSerial "${MODEL}" true) SN=$(generateSerial "${MODEL}" "true")
writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}" writeConfigKey "arc.patch" "true" "${USER_CONFIG_FILE}"
elif [ ${resp} -eq 2 ]; then elif [ ${resp} -eq 2 ]; then
# Generate random Serial # Generate random Serial
SN=$(generateSerial "${MODEL}" false) SN=$(generateSerial "${MODEL}" "false")
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
elif [ ${resp} -eq 3 ]; then elif [ ${resp} -eq 3 ]; then
while true; do while true; do
@ -578,7 +552,7 @@ function arcPatch() {
[ -z "${resp}" ] && return 1 [ -z "${resp}" ] && return 1
if [ ${resp} -eq 1 ]; then if [ ${resp} -eq 1 ]; then
# Generate random Serial # Generate random Serial
SN=$(generateSerial "${MODEL}" false) SN=$(generateSerial "${MODEL}" "false")
writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}" writeConfigKey "arc.patch" "false" "${USER_CONFIG_FILE}"
elif [ ${resp} -eq 2 ]; then elif [ ${resp} -eq 2 ]; then
while true; do while true; do

View File

@ -7,7 +7,6 @@ PART2_PATH="/mnt/p2"
PART3_PATH="/mnt/p3" PART3_PATH="/mnt/p3"
TMP_PATH="/tmp" TMP_PATH="/tmp"
UNTAR_PAT_PATH="${TMP_PATH}/DSM"
RAMDISK_PATH="${TMP_PATH}/ramdisk" RAMDISK_PATH="${TMP_PATH}/ramdisk"
LOG_FILE="${TMP_PATH}/log.txt" LOG_FILE="${TMP_PATH}/log.txt"
TMP_UP_PATH="${TMP_PATH}/upload" TMP_UP_PATH="${TMP_PATH}/upload"
@ -32,6 +31,7 @@ PATCH_PATH="${PART3_PATH}/patches"
LKMS_PATH="${PART3_PATH}/lkms" LKMS_PATH="${PART3_PATH}/lkms"
CUSTOM_PATH="${PART3_PATH}/custom" CUSTOM_PATH="${PART3_PATH}/custom"
USER_UP_PATH="${PART3_PATH}/users" USER_UP_PATH="${PART3_PATH}/users"
UNTAR_PAT_PATH="${PART3_PATH}/DSM"
S_FILE="${MODEL_CONFIG_PATH}/serials.yml" S_FILE="${MODEL_CONFIG_PATH}/serials.yml"
S_FILE_ARC="${MODEL_CONFIG_PATH}/arc_serials.yml" S_FILE_ARC="${MODEL_CONFIG_PATH}/arc_serials.yml"

View File

@ -6,13 +6,13 @@ function getnet() {
NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)" NICPORTS="$(readConfigKey "${MODEL}.ports" "${S_FILE}" 2>/dev/null)"
if [ "${ARCPATCH}" == "true" ]; then if [ "${ARCPATCH}" == "true" ]; then
ETHN="$(echo ${ETHX} | wc -w)" ETHN="$(echo ${ETHX} | wc -w)"
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" true)) MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "true"))
for I in $(seq 1 ${ETHN}); do for I in $(seq 1 ${ETHN}); do
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}" writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done done
elif [ "${ARCPATCH}" == "false" ]; then elif [ "${ARCPATCH}" == "false" ]; then
ETHN="$(echo ${ETHX} | wc -w)" ETHN="$(echo ${ETHX} | wc -w)"
MACS=($(generateMacAddress "${MODEL}" "${ETHN}" false)) MACS=($(generateMacAddress "${MODEL}" "${ETHN}" "false"))
for I in $(seq 1 ${ETHN}); do for I in $(seq 1 ${ETHN}); do
writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}" writeConfigKey "eth$((${I} - 1))" "${MACS[$((${I} - 1))]}" "${USER_CONFIG_FILE}"
done done