diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config index 8028df3..e3b8c1d 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-config @@ -205,7 +205,6 @@ logging() { } system_info() { - local cpu_architecture="armv7l (armhf 32bit)" local cpu_model="Rockchip rv1103 (rev$(awk '/CPU revision/ {print $4}' /proc/cpuinfo))" local cpu_serial="$(awk '/Serial/ {print $3}' /proc/cpuinfo)" @@ -215,6 +214,8 @@ system_info() { local swap="$(free -m | awk 'NR==3{printf "%d MB (%.2f%% free)", $2, ($4/$2)*100}')" local mounted_drives="$([ "$(for dir in /mnt/*/; do echo -n "/mnt${dir#"/mnt"} "; done)" ] && echo "Mounted drives: $(for dir in /mnt/*; do echo -n "/mnt${dir#"/mnt"} "; done | sed 's/\/$//')")" local os_version="Foxbuntu v$(grep -oP 'major=\K[0-9]+' /etc/foxbuntu-release).$(grep -oP 'minor=\K[0-9]+' /etc/foxbuntu-release)$(output=$(grep -o 'patch=[1-9][0-9]*' /etc/foxbuntu-release | cut -d= -f2) && [ -n "$output" ] && echo ".$output")$(grep -oP 'hotfix=\K[a-z]+' /etc/foxbuntu-release) ($(lsb_release -d | awk -F'\t' '{print $2}') $(lsb_release -c | awk -F'\t' '{print $2}'))" + local boot_modules="$(modules=$(sed -n '6,$p' /etc/modules | sed ':a;N;$!ba;s/\n/, /g;s/, $//'); [ -z "$modules" ] && echo "none" || echo "$modules")" + local i2c_addresses="$(i2cdetect -y 3 | awk 'NR>1 {for(i=2;i<=17;i++) if ($i == "ff" || $i == "UU") { printf "0x%02x ", (i-2) + (NR-2)*16} }' | tr -d '\n' )" local info="\ Femtofox\n\ Core: Luckfox Pico Mini\n\ @@ -237,7 +238,7 @@ Memory: $memory\n\ Swap: $swap\n\ $mounted_drives\n\ \n\ - Networking (wlan0 & eth0 only):\n\ + Networking (wlan0 & eth0):\n\ $(replace_colors "$(femto-network-config.sh -w | grep -v '^$' | grep -v '^MAC Address')")\n\ --- $(replace_colors "$(femto-network-config.sh -e)")\n\ @@ -245,11 +246,15 @@ $(replace_colors "$(femto-network-config.sh -e)")\n\ Attached devices:\n\ LoRa radio: $(replace_colors "$(femto-meshtasticd-config.sh -k)")\n\ $(lsusb | grep -v 'root hub' | awk 'NR>0{printf "USB: "; for(i=7;i<=NF;i++) printf "%s ", $i; print ""} END {if (NR == 0) printf "USB: None detected"}')\n\ -i2c devices: $(i2cdetect -y 3 | awk 'NR>1 {for(i=2;i<=17;i++) if ($i == "ff" || $i == "UU") { printf "0x%02x ", (i-2) + (NR-2)*16} }' | tr -d '\n' )\n\ +i2c devices: $i2c_addresses\n\ \n\ Kernel: Modules active: $(lsmod | awk 'NR>1 {print $1}' | tr '\n' ' ' && echo)\n\ -Boot modules: $(modules=$(sed -n '6,$p' /etc/modules | sed ':a;N;$!ba;s/\n/, /g;s/, $//'); [ -z "$modules" ] && echo "none" || echo "$modules")\ +Boot modules: $boot_modules\n\ +\n\ + Meshtasticd:\n\ +Service status: $(femto-meshtasticd-config.sh -S)\n\ +$(femto-meshtasticd-config.sh -i)\ " echo -e "$info" } diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-meshtasticd-config.sh b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-meshtasticd-config.sh index 881219b..5a20d76 100755 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-meshtasticd-config.sh +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/usr/local/bin/femto-meshtasticd-config.sh @@ -7,6 +7,7 @@ fi help=$(cat < 0" | bc) -eq 1 ]] && echo -e "Override freq: $overrideFrequency")\n\ +Uptime: $(echo "$output" | grep -oP '"uptimeSeconds":\s*\K\d+' | head -n 1 | awk '{days=int($1/86400); hrs=int(($1%86400)/3600); mins=int(($1%3600)/60); secs=int($1%60); printf "%d days %02d:%02d:%02d\n", days, hrs, mins, secs}')\n\ +Public key: $(echo "$output" | grep -oP '"publicKey":\s*"\K[^"]+' | head -n 1)\ +" + ;; g) # Option -g (get config URL) url=$(meshtastic --host --qr-all | grep -oP '(?<=Complete URL \(includes all channels\): )https://[^ ]+') #add look for errors clear @@ -142,9 +158,9 @@ while getopts ":hgkl:q:va:cpo:sStruxm" opt; do ;; S) # Option -S (Get Meshtasticd Service state) if echo "$(systemctl status meshtasticd)" | grep -q "active (running)"; then - echo -e "\033[4m\033[0;34monline\033[0m" + echo -e "\033[4m\033[0;34mrunning\033[0m" elif echo "$(systemctl status meshtasticd)" | grep -q "inactive (dead)"; then - echo -e "\033[4m\033[0;31moffline\033[0m" + echo -e "\033[4m\033[0;31mnot running\033[0m" else echo "unknown" fi