From 46ba5929e3a417a627cc8bd8961fed4b8b813406 Mon Sep 17 00:00:00 2001 From: Joey Turner Date: Mon, 14 Oct 2024 02:16:51 -0500 Subject: [PATCH 1/3] refactored see_full_list Add sub level to nesting filter Did not include the id as they are shown in the help section lower in the document. can include if needed --- lib/armbian-configng/config.ng.docs.sh | 49 ++++++++++++++------------ 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/lib/armbian-configng/config.ng.docs.sh b/lib/armbian-configng/config.ng.docs.sh index bf4f9cfb6..ad2bbd910 100644 --- a/lib/armbian-configng/config.ng.docs.sh +++ b/lib/armbian-configng/config.ng.docs.sh @@ -356,38 +356,43 @@ function see_jobs_from_json_md() { } + + function see_full_list() { + # Use jq to parse the JSON into markdown + menu_items=$(echo "$json_data" | jq -r '.menu | length') - # Use jq to parse the JSON into markdown - menu_items=$(jq -r '.menu | length' "$json_file") + for ((i = 0; i < menu_items; i++)); do + cat=$(jq -r ".menu[$i].id" "$json_file") + description=$(jq -r ".menu[$i].description" "$json_file") - for ((i = 0; i < $menu_items; i++)); do - cat=$(jq -r ".menu[$i].id" "$json_file") - description=$(jq -r ".menu[$i].description" "$json_file") + echo -e "- ## **$cat** \n" - echo -e "- ## **$cat** " - #echo "$description" + sub_items=$(jq -r ".menu[$i].sub | length" "$json_file") - sub_items=$(jq -r ".menu[$i].sub | length" "$json_file") + for ((j = 0; j < sub_items; j++)); do + id=$(jq -r ".menu[$i].sub[$j].id" "$json_file") + sub_description=$(jq -r ".menu[$i].sub[$j].description" "$json_file") - for ((j = 0; j < $sub_items; j++)); do - id=$(jq -r ".menu[$i].sub[$j].id" "$json_file") - id_link=$(jq -r ".menu[$i].sub[$j].id" "$json_file" | tr '[:upper:]' '[:lower:]') - description=$(jq -r ".menu[$i].sub[$j].description" "$json_file") - command=$(jq -r ".menu[$i].sub[$j].command" "$json_file") - status=$(jq -r ".menu[$i].sub[$j].status" "$json_file") - doc_link=$(jq -r ".menu[$i].sub[$j].doc_link" "$json_file") + echo -e " - ### $sub_description" - # Check if src_reference and doc_link are null - [ -z "$doc_link" ] && doc_link="#$id_link" || doc_link="$doc_link" + # Handle nested sub-items + nested_sub_items=$(jq -r ".menu[$i].sub[$j].sub | length" "$json_file") - echo -e " - **$id** - $description" - # echo -e " - Status: [$status]($doc_link)" + # Check if nested sub-items are present + if [ "$nested_sub_items" -gt 0 ]; then + for ((k = 0; k < nested_sub_items; k++)); do + nested_id=$(jq -r ".menu[$i].sub[$j].sub[$k].id" "$json_file") + nested_description=$(jq -r ".menu[$i].sub[$j].sub[$k].description" "$json_file") - done - echo -e "\n" - done + echo -e " - ### $nested_description" + done + fi + echo -e "\n" + done + echo -e "\n" + done } module_options+=( From fc2279298870cd95e1e05cf32def41f7aae4ac31 Mon Sep 17 00:00:00 2001 From: Tearran Date: Mon, 14 Oct 2024 00:22:20 -0700 Subject: [PATCH 2/3] fixed code style --- lib/armbian-configng/config.ng.docs.sh | 50 +++++++++++++------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/armbian-configng/config.ng.docs.sh b/lib/armbian-configng/config.ng.docs.sh index ad2bbd910..4dfeb99b1 100644 --- a/lib/armbian-configng/config.ng.docs.sh +++ b/lib/armbian-configng/config.ng.docs.sh @@ -359,40 +359,40 @@ function see_jobs_from_json_md() { function see_full_list() { - # Use jq to parse the JSON into markdown - menu_items=$(echo "$json_data" | jq -r '.menu | length') + # Use jq to parse the JSON into markdown + menu_items=$(echo "$json_data" | jq -r '.menu | length') - for ((i = 0; i < menu_items; i++)); do - cat=$(jq -r ".menu[$i].id" "$json_file") - description=$(jq -r ".menu[$i].description" "$json_file") + for ((i = 0; i < menu_items; i++)); do + cat=$(jq -r ".menu[$i].id" "$json_file") + description=$(jq -r ".menu[$i].description" "$json_file") - echo -e "- ## **$cat** \n" + echo -e "- ## **$cat** \n" - sub_items=$(jq -r ".menu[$i].sub | length" "$json_file") + sub_items=$(jq -r ".menu[$i].sub | length" "$json_file") - for ((j = 0; j < sub_items; j++)); do - id=$(jq -r ".menu[$i].sub[$j].id" "$json_file") - sub_description=$(jq -r ".menu[$i].sub[$j].description" "$json_file") + for ((j = 0; j < sub_items; j++)); do + id=$(jq -r ".menu[$i].sub[$j].id" "$json_file") + sub_description=$(jq -r ".menu[$i].sub[$j].description" "$json_file") - echo -e " - ### $sub_description" + echo -e " - ### $sub_description" - # Handle nested sub-items - nested_sub_items=$(jq -r ".menu[$i].sub[$j].sub | length" "$json_file") + # Handle nested sub-items + nested_sub_items=$(jq -r ".menu[$i].sub[$j].sub | length" "$json_file") - # Check if nested sub-items are present - if [ "$nested_sub_items" -gt 0 ]; then - for ((k = 0; k < nested_sub_items; k++)); do - nested_id=$(jq -r ".menu[$i].sub[$j].sub[$k].id" "$json_file") - nested_description=$(jq -r ".menu[$i].sub[$j].sub[$k].description" "$json_file") + # Check if nested sub-items are present + if [ "$nested_sub_items" -gt 0 ]; then + for ((k = 0; k < nested_sub_items; k++)); do + nested_id=$(jq -r ".menu[$i].sub[$j].sub[$k].id" "$json_file") + nested_description=$(jq -r ".menu[$i].sub[$j].sub[$k].description" "$json_file") - echo -e " - ### $nested_description" - done - fi + echo -e " - ### $nested_description" + done + fi - echo -e "\n" - done - echo -e "\n" - done + echo -e "\n" + done + echo -e "\n" + done } module_options+=( From 7c8bb6218b120db3b741e1b21675601cdf3f4149 Mon Sep 17 00:00:00 2001 From: Tearran Date: Mon, 14 Oct 2024 00:31:52 -0700 Subject: [PATCH 3/3] ran --doc --- DOCUMENTATION.md | 206 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 164 insertions(+), 42 deletions(-) diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index e56dcc56c..986f66723 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -11,54 +11,175 @@ sudo armbian-config ~~~ - ## **System** - - **S01** - Enable Armbian kernel/firmware upgrades - - **S02** - Disable Armbian kernel upgrades - - **S03** - Edit the boot environment - - **S04** - Install Linux headers - - **S05** - Remove Linux headers - - **S06** - Install to internal storage - - **S07.1** - Manage SSH login options - - **S17** - Change shell system wide to BASH - - **S18** - Change shell system wide to ZSH - - **S19** - Switch to rolling release - - **S20** - Switch to stable release - - **S21** - Enable read only filesystem - - **S22** - Disable read only filesystem - - **S23** - Adjust welcome screen (motd) - - **S24** - Install alternative kernels - - **S25** - Distribution upgrades - - **S28** - Manage device tree overlays + + - ### Enable Armbian kernel/firmware upgrades + + + - ### Disable Armbian kernel upgrades + + + - ### Edit the boot environment + + + - ### Install Linux headers + + + - ### Remove Linux headers + + + - ### Install to internal storage + + + - ### Manage SSH login options + - ### Disable root login + - ### Enable root login + - ### Disable password login + - ### Enable password login + - ### Disable Public key authentication login + - ### Enable Public key authentication login + - ### Disable OTP authentication + - ### Enable OTP authentication + - ### Generate new OTP authentication QR code + - ### Show OTP authentication QR code + - ### Disable last login banner + - ### Enable last login banner + + + - ### Change shell system wide to BASH + + + - ### Change shell system wide to ZSH + + + - ### Switch to rolling release + + + - ### Switch to stable release + + + - ### Enable read only filesystem + + + - ### Disable read only filesystem + + + - ### Adjust welcome screen (motd) + + + - ### Install alternative kernels + + + - ### Distribution upgrades + - ### Upgrade to latest stable / LTS + - ### Upgrade to rolling unstable + + + - ### Manage device tree overlays + + - ## **Network** - - **N01** - Configure network interfaces - - **N15** - Install Bluetooth support - - **N16** - Remove Bluetooth support - - **N17** - Bluetooth Discover - - **N18** - Toggle system IPv6/IPv4 internet protocol + + - ### Configure network interfaces + - ### Add / change interface + - ### Revert to Armbian defaults + - ### Show configuration + - ### Show active status + + + - ### Install Bluetooth support + + + - ### Remove Bluetooth support + + + - ### Bluetooth Discover + + + - ### Toggle system IPv6/IPv4 internet protocol + + - ## **Localisation** - - **L00** - Change Global timezone (WIP) - - **L01** - Change Locales reconfigure the language and character set - - **L02** - Change Keyboard layout - - **L03** - Change APT mirrors - - **L04** - Change System Hostname + + - ### Change Global timezone (WIP) + + + - ### Change Locales reconfigure the language and character set + + + - ### Change Keyboard layout + + + - ### Change APT mirrors + + + - ### Change System Hostname + + - ## **Software** - - **Desktops** - Desktop Environments - - **Netconfig** - Network tools - - **DevTools** - Development - - **Benchy** - System benchmaking and diagnostics - - **Containers** - Containerlization and Virtual Machines - - **Media** - Media Servers and Editors - - **Management** - Remote Management tools + + - ### Desktop Environments + - ### XFCE desktop + - ### Gnome desktop + - ### i3-wm desktop + - ### Cinnamon desktop + - ### Kde-neon desktop + - ### Improve application search speed + + + - ### Network tools + - ### Install realtime console network usage monitor (nload) + - ### Remove realtime console network usage monitor (nload) + - ### Install bandwidth measuring tool (iperf3) + - ### Remove bandwidth measuring tool (iperf3) + - ### Install IP LAN monitor (iptraf-ng) + - ### Remove IP LAN monitor (iptraf-ng) + - ### Install hostname broadcast via mDNS (avahi-daemon) + - ### Remove hostname broadcast via mDNS (avahi-daemon) + + + - ### Development + - ### Install tools for cloning and managing repositories (git) + - ### Remove tools for cloning and managing repositories (git) + + + - ### System benchmaking and diagnostics + + + - ### Containerlization and Virtual Machines + - ### Install Docker Minimal + - ### Install Docker Engine + - ### Remove Docker + - ### Purge all Docker images, containers, and volumes + + + - ### Media Servers and Editors + - ### Install Plex Media server + - ### Remove Plex Media server + - ### Install Emby server + - ### Remove Emby server + + + - ### Remote Management tools + - ### Install Cockpit web-based management tool + - ### Purge Cockpit web-based management tool + - ### Start Cockpit Service + - ### Stop Cockpit Service + + - ## **Help** - - **H00** - About This system. (WIP) - - **H02** - List of Config function(WIP) + + - ### About This system. (WIP) + + + - ### List of Config function(WIP) ## Install Armbian installation @@ -91,7 +212,7 @@ armbian-config --help Outputs: ~~~ - System - System wide and admin settings (x86_64) + System - System wide and admin settings (aarch64) --cmd S01 - Enable Armbian kernel/firmware upgrades --cmd S02 - Disable Armbian kernel upgrades --cmd S03 - Edit the boot environment @@ -124,7 +245,7 @@ Outputs: --cmd S27 - Upgrade to rolling unstable --cmd S28 - Manage device tree overlays - Network - Fixed and wireless network settings (eth0) + Network - Fixed and wireless network settings (wlan0) N01 - Configure network interfaces --cmd N02 - Add / change interface --cmd N03 - Revert to Armbian defaults @@ -135,7 +256,7 @@ Outputs: --cmd N17 - Bluetooth Discover --cmd N18 - Toggle system IPv6/IPv4 internet protocol - Localisation - Localisation (C.UTF-8) + Localisation - Localisation (en_US.UTF-8) --cmd L00 - Change Global timezone (WIP) --cmd L01 - Change Locales reconfigure the language and character set --cmd L02 - Change Keyboard layout @@ -190,14 +311,14 @@ Outputs: --cmd SW28 - Purge all Docker images, containers, and volumes Media - Media Servers and Editors --cmd SW21 - Install Plex Media server - --cmd SW22 - Remove Plex Media server + --cmd SW22 - Remove Plex Media server (https://localhost:32400) --cmd SW23 - Install Emby server - --cmd SW24 - Remove Emby server + --cmd SW24 - Remove Emby server (https://localhost:8096) Management - Remote Management tools --cmd M00 - Install Cockpit web-based management tool --cmd M01 - Purge Cockpit web-based management tool --cmd M02 - Start Cockpit Service - --cmd M03 - Stop Cockpit Service + --cmd M03 - Stop Cockpit Service (https://localhost:9090) Help - About this app --cmd H00 - About This system. (WIP) @@ -669,6 +790,7 @@ These helper functions facilitate various operations related to job management, | Update JSON data with system information | update_json_data | Joey Turner | pipeline strings to an infobox | show_infobox <<< 'hello world' ; | Joey Turner | Stop hostapd, clean config | default_wireless_network_config | Igor Pecovnik +| Update sub-submenu descriptions based on conditions | update_sub_submenu_data "MenuID" "SubID" "SubSubID" "CMD" | @Tearran | Parse json to get list of desired menu or submenu items | parse_menu_items 'menu_options_array' | Gunjan Gupta | Show the usage of the functions. | see_use | Joey Turner | Install Desktop environment | manage_desktops xfce install | @igorpecovnik