network: more rewrite

Signed-off-by: AuxXxilium <info@auxxxilium.tech>
This commit is contained in:
AuxXxilium
2024-03-28 16:36:15 +01:00
parent 9d047ee82f
commit d43fb06545
5 changed files with 10 additions and 10 deletions

View File

@@ -1210,7 +1210,7 @@ function sysinfo() {
# Get System Informations
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')"
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
NIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@@ -1439,7 +1439,7 @@ function fullsysinfo() {
# Get System Informations
CPU="$(echo $(cat /proc/cpuinfo 2>/dev/null | grep 'model name' | uniq | awk -F':' '{print $2}'))"
VENDOR="$(dmesg 2>/dev/null | grep -i "DMI:" | sed 's/\[.*\] DMI: //i')"
ETHX=$(ls /sys/class/net/ | grep -v lo || true)
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
NIC="$(readConfigKey "device.nic" "${USER_CONFIG_FILE}")"
CONFDONE="$(readConfigKey "arc.confdone" "${USER_CONFIG_FILE}")"
BUILDDONE="$(readConfigKey "arc.builddone" "${USER_CONFIG_FILE}")"
@@ -1676,7 +1676,7 @@ function fullsysinfo() {
# Shows Networkdiag to user
function networkdiag() {
MSG=""
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for ETH in ${ETHX}; do
MSG+="Interface: ${ETH}\n"
addr=$(getIP ${ETH})
@@ -1751,7 +1751,7 @@ function credits() {
# allow setting Static IP for Loader
function staticIPMenu() {
# Get Amount of NIC
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for ETH in ${ETHX}; do
STATIC="$(readConfigKey "static.${ETH}" "${USER_CONFIG_FILE}")"
DRIVER=$(ls -ld /sys/class/net/${ETH}/device/driver 2>/dev/null | awk -F '/' '{print $NF}')

View File

@@ -82,7 +82,7 @@ KERNELLOAD="$(readConfigKey "arc.kernelload" "${USER_CONFIG_FILE}")"
KERNELPANIC="$(readConfigKey "arc.kernelpanic" "${USER_CONFIG_FILE}")"
DIRECTBOOT="$(readConfigKey "arc.directboot" "${USER_CONFIG_FILE}")"
EMMCBOOT="$(readConfigKey "arc.emmcboot" "${USER_CONFIG_FILE}")"
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
declare -A CMDLINE

View File

@@ -1,6 +1,6 @@
# Get Network Config for Loader
function getnet() {
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
ARCPATCH="$(readConfigKey "arc.patch" "${USER_CONFIG_FILE}")"
if [ "${ARCPATCH}" = "true" ]; then
ARCMACNUM=1
@@ -52,7 +52,7 @@ function getnet() {
}
# Get Amount of NIC
ETHX=$(ls /sys/class/net/ | grep eth) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
# Get actual IP
for ETH in ${ETHX}; do
IPCON="$(readConfigKey "ip.${ETH}" "${USER_CONFIG_FILE}")"

View File

@@ -74,7 +74,7 @@ else
fi
# Init Network
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
MACSYS="$(readConfigKey "arc.macsys" "${USER_CONFIG_FILE}")"
# Write Mac to config
NIC=0

View File

@@ -158,7 +158,7 @@ chmod +x "${RAMDISK_PATH}/addons/addons.sh"
# Required addons: "revert" "misc" "eudev" "disks" "localrss" "wol"
# This order cannot be changed.
for ADDON in "revert" "misc" "eudev" "disks" "localrss" "wol"; do
for ADDON in "revert" "misc" "eudev" "disks" "localrss" "notify" "wol"; do
PARAMS=""
if [ "${ADDON}" = "disks" ]; then
PARAMS="${HDDSORT} ${USBMOUNT}"
@@ -216,7 +216,7 @@ done
# Network card configuration file
IPV6="$(readConfigKey "arc.ipv6" "${USER_CONFIG_FILE}")"
ETHX=$(ls /sys/class/net/ | grep -v lo) || true
ETHX=$(ls /sys/class/net/ 2>/dev/null | grep eth) || true
for ETH in ${ETHX}; do
if [ "${IPV6}" = "true" ]; then
echo -e "DEVICE=${ETH}\nBOOTPROTO=dhcp\nONBOOT=yes\nIPV6INIT=dhcp\nIPV6_ACCEPT_RA=1" >"${RAMDISK_PATH}/etc/sysconfig/network-scripts/ifcfg-${ETH}"