tree: rework more features

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium 2024-06-14 17:34:49 +02:00
parent ad1b0d2d1f
commit db81cb490b
3 changed files with 32 additions and 28 deletions

View File

@ -1032,19 +1032,19 @@ function sysinfo() {
if [ -n "${IP}" ]; then if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}') SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then if [[ "${IP}" =~ ^169\.254\..* ]]; then
TEXT+="\n ${DRIVER} (${SPEED} | ${MSG}):\Zb LINK LOCAL | Mac: ${MACR} (${MAC})\Zn" TEXT+="\n ${ETH} -> ${DRIVER} (${SPEED} | ${MSG}):\Zb LINK LOCAL | Mac: ${MACR} (${MAC})\Zn"
else else
TEXT+="\n ${DRIVER} (${SPEED} | ${MSG}):\Zb ${IP} | Mac: ${MACR} (${MAC})\Zn" TEXT+="\n ${ETH} -> ${DRIVER} (${SPEED} | ${MSG}):\Zb ${IP} | Mac: ${MACR} (${MAC})\Zn"
fi fi
break break
fi fi
if [ ${COUNT} -gt 3 ]; then if [ ${COUNT} -gt 3 ]; then
TEXT+="\n ${DRIVER}\Zb: TIMEOUT | MAC: ${MACR} (${MAC})\Zn" TEXT+="\n ${ETH} -> ${DRIVER}\Zb: TIMEOUT | MAC: ${MACR} (${MAC})\Zn"
break break
fi fi
sleep 3 sleep 3
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
TEXT+="\n ${DRIVER}\Zb: NOT CONNECTED | MAC: ${MACR} (${MAC})\Zn" TEXT+="\n ${ETH} -> ${DRIVER}\Zb: NOT CONNECTED | MAC: ${MACR} (${MAC})\Zn"
break break
fi fi
COUNT=$((${COUNT} + 3)) COUNT=$((${COUNT} + 3))
@ -1058,13 +1058,14 @@ function sysinfo() {
TEXT+="\n\Z4>> Loader\Zn" TEXT+="\n\Z4>> Loader\Zn"
TEXT+="\n Config | Build: \Zb${CONFDONE} | ${BUILDDONE}\Zn" TEXT+="\n Config | Build: \Zb${CONFDONE} | ${BUILDDONE}\Zn"
TEXT+="\n Config Version: \Zb${CONFIGVER}\Zn" TEXT+="\n Config Version: \Zb${CONFIGVER}\Zn"
TEXT+="\n\Z4>> DSM ${PRODUCTVER}: ${MODELID:-${MODEL}}\Zn" if [ "${CONFDONE}" == "true" ]; then
TEXT+="\n Kernel | LKM: \Zb${KVER} | ${LKM}\Zn" TEXT+="\n\Z4>> DSM ${PRODUCTVER}: ${MODELID:-${MODEL}}\Zn"
TEXT+="\n Platform | DeviceTree: \Zb${PLATFORM} | ${DT}\Zn" TEXT+="\n Kernel | LKM: \Zb${KVER} | ${LKM}\Zn"
TEXT+="\n Arc Patch | Kernelload: \Zb${ARCPATCH} | ${KERNELLOAD}\Zn" TEXT+="\n Platform | DeviceTree: \Zb${PLATFORM} | ${DT}\Zn"
TEXT+="\n Directboot: \Zb${DIRECTBOOT}\Zn" TEXT+="\n Arc Patch | Kernelload: \Zb${ARCPATCH} | ${KERNELLOAD}\Zn"
TEXT+="\n\Z4>> Addons | Modules\Zn" TEXT+="\n Directboot: \Zb${DIRECTBOOT}\Zn"
TEXT+="\n Addons selected: \Zb${ADDONSINFO}\Zn" TEXT+="\n Addons selected: \Zb${ADDONSINFO}\Zn"
fi
TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn" TEXT+="\n Modules loaded: \Zb${MODULESINFO}\Zn"
TEXT+="\n\Z4>> Settings\Zn" TEXT+="\n\Z4>> Settings\Zn"
TEXT+="\n MacSys: \Zb${MACSYS}\Zn" TEXT+="\n MacSys: \Zb${MACSYS}\Zn"
@ -1267,19 +1268,19 @@ function fullsysinfo() {
if [ -n "${IP}" ]; then if [ -n "${IP}" ]; then
SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}') SPEED=$(ethtool ${ETH} 2>/dev/null | grep "Speed:" | awk '{print $2}')
if [[ "${IP}" =~ ^169\.254\..* ]]; then if [[ "${IP}" =~ ^169\.254\..* ]]; then
TEXT+="\n${DRIVER} (${SPEED} | ${MSG}): LINK LOCAL | Mac: ${MACR} (${MAC}) @ ${NETBUS}" TEXT+="\n${ETH} -> ${DRIVER} (${SPEED} | ${MSG}): LINK LOCAL | Mac: ${MACR} (${MAC}) @ ${NETBUS}"
else else
TEXT+="\n${DRIVER} (${SPEED} | ${MSG}): ${IP} | Mac: ${MACR} (${MAC}) @ ${NETBUS}" TEXT+="\n${ETH} -> ${DRIVER} (${SPEED} | ${MSG}): ${IP} | Mac: ${MACR} (${MAC}) @ ${NETBUS}"
fi fi
break break
fi fi
if [ ${COUNT} -gt 3 ]; then if [ ${COUNT} -gt 3 ]; then
TEXT+="\n${DRIVER}: TIMEOUT | MAC: ${MACR} (${MAC}) @ ${NETBUS}" TEXT+="\n${ETH} -> ${DRIVER}: TIMEOUT | MAC: ${MACR} (${MAC}) @ ${NETBUS}"
break break
fi fi
sleep 3 sleep 3
if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then if ethtool ${ETH} 2>/dev/null | grep 'Link detected' | grep -q 'no'; then
TEXT+="\n${DRIVER}: NOT CONNECTED | MAC: ${MACR} (${MAC}) @ ${NETBUS}" TEXT+="\n${ETH} -> ${DRIVER}: NOT CONNECTED | MAC: ${MACR} (${MAC}) @ ${NETBUS}"
break break
fi fi
COUNT=$((${COUNT} + 3)) COUNT=$((${COUNT} + 3))
@ -1297,16 +1298,18 @@ function fullsysinfo() {
TEXT+="\nLoader" TEXT+="\nLoader"
TEXT+="\nConfig | Build: ${CONFDONE} | ${BUILDDONE}" TEXT+="\nConfig | Build: ${CONFDONE} | ${BUILDDONE}"
TEXT+="\nConfig Version: ${CONFIGVER}" TEXT+="\nConfig Version: ${CONFIGVER}"
TEXT+="\n" if [ "${CONFDONE}" == "true" ]; then
TEXT+="\nDSM ${PRODUCTVER}: ${MODELID:-${MODEL}}" TEXT+="\n"
TEXT+="\nKernel | LKM: ${KVER} | ${LKM}" TEXT+="\nDSM ${PRODUCTVER}: ${MODELID:-${MODEL}}"
TEXT+="\nPlatform | DeviceTree: ${PLATFORM} | ${DT}" TEXT+="\nKernel | LKM: ${KVER} | ${LKM}"
TEXT+="\nArc Patch | Kernelload: ${ARCPATCH} | ${KERNELLOAD}" TEXT+="\nPlatform | DeviceTree: ${PLATFORM} | ${DT}"
TEXT+="\nDirectboot: ${DIRECTBOOT}" TEXT+="\nArc Patch | Kernelload: ${ARCPATCH} | ${KERNELLOAD}"
TEXT+="\n" TEXT+="\nDirectboot: ${DIRECTBOOT}"
TEXT+="\nAddons selected:" TEXT+="\n"
TEXT+="\n${ADDONSINFO}" TEXT+="\nAddons selected:"
TEXT+="\n" TEXT+="\n${ADDONSINFO}"
TEXT+="\n"
fi
TEXT+="\nModules loaded:" TEXT+="\nModules loaded:"
TEXT+="\n${MODULESINFO}" TEXT+="\n${MODULESINFO}"
TEXT+="\n" TEXT+="\n"

View File

@ -33,7 +33,7 @@ BUS=$(getBus "${LOADER_DISK}")
CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")" CUSTOM="$(readConfigKey "arc.custom" "${USER_CONFIG_FILE}")"
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) # real network cards list ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) # real network cards list
for ETH in ${ETHX}; do for ETH in ${ETHX}; do
if ping -I ${ETH} -c 1 "github.com" > /dev/null 2>&1; then if curl --interface ${ETH} -m 5 -skL https://api.github.com/repos/AuxXxilium/arc/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}' > /dev/null 2>&1; then
ARCNIC=${ETH} ARCNIC=${ETH}
break break
fi fi
@ -482,7 +482,6 @@ function arcSettings() {
return 0 return 0
fi fi
# Select Portmap for Loader # Select Portmap for Loader
getmap
if [ "${DT}" == "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then if [ "${DT}" == "false" ] && [ $(lspci -d ::106 | wc -l) -gt 0 ]; then
dialog --backtitle "$(backtitle)" --colors --title "Storage Map" \ dialog --backtitle "$(backtitle)" --colors --title "Storage Map" \
--infobox "Generating Storage Map..." 3 35 --infobox "Generating Storage Map..." 3 35

View File

@ -235,4 +235,6 @@ RAIDCONTROLLER=$(lspci -d ::104 | wc -l)
writeConfigKey "device.raidcontroller" "${RAIDCONTROLLER}" "${USER_CONFIG_FILE}" writeConfigKey "device.raidcontroller" "${RAIDCONTROLLER}" "${USER_CONFIG_FILE}"
if [ ${RAIDCONTROLLER} -gt 0 ]; then if [ ${RAIDCONTROLLER} -gt 0 ]; then
writeConfigKey "device.externalcontroller" "true" "${USER_CONFIG_FILE}" writeConfigKey "device.externalcontroller" "true" "${USER_CONFIG_FILE}"
fi fi
# Check Controller for Disks
getmap