diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index 71ca0aeb..46ef6d7e 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -78,6 +78,9 @@ sudo armbian-config - ### ZFS filesystem - remove support + - ### Select Odroid board configuration + + - ## **Network** @@ -293,6 +296,7 @@ Outputs: --cmd SY017 - Manage device tree overlays --cmd SY018 - ZFS filesystem - enable support --cmd SY019 - ZFS filesystem - remove support + --cmd SY020 - Select Odroid board configuration Network - Fixed and wireless network settings (eth0) NE001 - Configure network interfaces @@ -319,36 +323,36 @@ Outputs: --cmd NET008 - Remove hostname broadcast via mDNS (avahi-daemon) Downloaders - Download tools --cmd DOW001 - Install qBittorrent - --cmd DOW002 - Remove qBittorrent (http://10.1.0.10:8090 6881) + --cmd DOW002 - Remove qBittorrent (http://10.1.0.84:8090 6881) --cmd DOW003 - Install Deluge - --cmd DOW004 - Remove Deluge (http://10.1.0.10:8112 6181 58846) + --cmd DOW004 - Remove Deluge (http://10.1.0.84:8112 6181 58846) --cmd DOW005 - Install Transmission - --cmd DOW006 - Remove Transmission (http://10.1.0.10:9091) + --cmd DOW006 - Remove Transmission (http://10.1.0.84:9091) --cmd DOW011 - Install SABnzbd - --cmd DOW012 - Remove SABnzbd (http://10.1.0.10:8080) + --cmd DOW012 - Remove SABnzbd (http://10.1.0.84:8080) --cmd DOW013 - Install Medusa - --cmd DOW014 - Remove Medusa (http://10.1.0.10:8081) + --cmd DOW014 - Remove Medusa (http://10.1.0.84:8081) --cmd DOW015 - Install Sonarr - --cmd DOW016 - Remove Sonarr (http://10.1.0.10:8989) + --cmd DOW016 - Remove Sonarr (http://10.1.0.84:8989) --cmd DOW017 - Install Radarr - --cmd DOW018 - Remove Radarr (http://10.1.0.10:7878) + --cmd DOW018 - Remove Radarr (http://10.1.0.84:7878) --cmd DOW019 - Install Bazarr - --cmd DOW020 - Remove Bazarr (http://10.1.0.10:6767) + --cmd DOW020 - Remove Bazarr (http://10.1.0.84:6767) --cmd DOW021 - Install Lidarr - --cmd DOW022 - Remove Lidarr (http://10.1.0.10:8686) + --cmd DOW022 - Remove Lidarr (http://10.1.0.84:8686) --cmd DOW023 - Install Readarr - --cmd DOW024 - Remove Readarr (http://10.1.0.10:8787) + --cmd DOW024 - Remove Readarr (http://10.1.0.84:8787) --cmd DOW025 - Install Prowlarr - --cmd DOW026 - Remove Prowlarr (http://10.1.0.10:9696) + --cmd DOW026 - Remove Prowlarr (http://10.1.0.84:9696) --cmd DOW040 - Jellyseerr install - --cmd DOW041 - Jellyseerr remove (http://10.1.0.10:5055) + --cmd DOW041 - Jellyseerr remove (http://10.1.0.84:5055) --cmd DOW042 - Jellyseerr purge data folder Database - Database --cmd DAT001 - Mariadb install - --cmd DAT002 - Mariadb remove (Server: 10.1.0.10) + --cmd DAT002 - Mariadb remove (Server: 10.1.0.84) --cmd DAT003 - Mariadb purge --cmd DAT005 - phpMyAdmin install - --cmd DAT006 - phpMyAdmin remove (http://10.1.0.10:8071) + --cmd DAT006 - phpMyAdmin remove (http://10.1.0.84:8071) --cmd DAT007 - phpMyAdmin purge DNS - DNS blockers --cmd DNS001 - Install Pi-hole DNS ad blocker @@ -361,7 +365,7 @@ Outputs: --cmd HA001 - Install openHAB --cmd HA002 - Remove openHAB --cmd HA003 - Install Home Assistant - --cmd HA004 - Remove Home Assistant (http://10.1.0.10:8123) + --cmd HA004 - Remove Home Assistant (http://10.1.0.84:8123) --cmd Benchy - System benchmaking and diagnostics Containers - Containerlization and Virtual Machines --cmd CON001 - Install Docker Minimal @@ -369,7 +373,7 @@ Outputs: --cmd CON003 - Remove Docker --cmd CON004 - Purge all Docker images, containers, and volumes --cmd CON005 - Install Portainer - --cmd CON006 - Remove Portainer (http://10.1.0.10:9000) + --cmd CON006 - Remove Portainer (http://10.1.0.84:9000) --cmd CON007 - Watchtower install --cmd CON008 - Watchtower remove Media - Media Servers and Editors @@ -381,13 +385,13 @@ Outputs: --cmd MED011 - Stirling-PDF Remove --cmd MED012 - Stirling-PDF Purge data folder --cmd MED015 - Syncthing Install - --cmd MED016 - Syncthing Remove (http://10.1.0.10:8884) + --cmd MED016 - Syncthing Remove (http://10.1.0.84:8884) --cmd MED017 - Syncthing Purge data folder --cmd MED020 - Nextcloud Install - --cmd MED021 - Nextcloud Remove (https://10.1.0.10:443) + --cmd MED021 - Nextcloud Remove (https://10.1.0.84:443) --cmd MED022 - Nextcloud Purge data folder --cmd MED025 - Owncloud Install - --cmd MED026 - Owncloud Remove (http://10.1.0.10:7787) + --cmd MED026 - Owncloud Remove (http://10.1.0.84:7787) --cmd MED027 - Owncloud Purge data folder Monitoring - Monitoring --cmd MON001 - Uptime Kuma install @@ -619,6 +623,16 @@ Jobs: module_zfs remove ~~~ +### SY020 + +Select Odroid board configuration + +Jobs: + +~~~ +manage_odroid_board select +~~~ + ### NE001 Configure network interfaces @@ -860,6 +874,7 @@ These helper functions facilitate various operations related to job management, | Netplan wrapper | network_config | @igorpecovnik | Install medusa container | install remove status help | @armbian | Install syncthing container | install remove purge status help | +| Select optimised Odroid board configuration | select | @GeoffClements | Install owncloud container | install remove purge status help | @armbian | Install netdata container | install remove purge status help | @armbian | Change the background color of the terminal or dialog box | set_colors 0-7 | @Tearran diff --git a/tools/json/config.system.json b/tools/json/config.system.json index 785bc4e5..a35b99ca 100644 --- a/tools/json/config.system.json +++ b/tools/json/config.system.json @@ -352,6 +352,16 @@ "status": "Stable", "author": "@armbian", "condition": "module_zfs status" + }, + { + "id": "SY020", + "description": "Select Odroid board configuration", + "command": [ + "manage_odroid_board select" + ], + "status": "Preview", + "author": "", + "condition": "[ $BOARDFAMILY == odroidxu4 ]" } ] } diff --git a/tools/modules/network/network_config.sh b/tools/modules/network/network_config.sh index 774fe84f..0dcdf56b 100644 --- a/tools/modules/network/network_config.sh +++ b/tools/modules/network/network_config.sh @@ -55,19 +55,38 @@ function network_config() { ;; sta) + LIST=() ip link set ${adapter} up - default_wireless_network_config "${yamlfile}" "${adapter}" + local stationslist=$(mktemp /tmp/wifi.XXXXXX) + for wificycles in $(seq 1 1 10); do LIST=() - for i in {1..3}; do - LIST=($(iw dev ${adapter} scan 2> /dev/null | grep 'SSID\|^BSS' | cut -d" " -f2 | sed "s/(.*//g" | xargs -n2 -d'\n' | awk '{print $2,$1}')) - sleep 3 - [[ "${#LIST[@]}" -gt 0 ]]; break - done - LIST_LENGTH=$((${#LIST[@]} / 2)) + iw ${adapter} scan 2> /dev/null | \ + grep 'freq:\|SSID:\|signal:' \ + | sed 's/.*:"//;s/"//' \ + | xargs -n3 -d'\n' \ + | sort -k4 -nr \ + | sed "s/freq: //g" \ + | sed "s/signal: //g" \ + | sed "s/SSID: //g" \ + > $stationslist + if [[ $? -eq 0 && $(cat "${stationslist}" | wc -l) -gt 0 ]]; then + break + fi + sleep 1 + done | $DIALOG --title "" --infobox "Scanning. Please wait" 4 26 + # construct second array + while IFS=$'\t' read -r -a wifiArray + do + # if SSID is not blank, add to new list + if [[ -n "${wifiArray[2]}" ]]; then + LIST+=("${wifiArray[2]}" "$(printf "%-30s" "${wifiArray[2]}") ${wifiArray[1]} ${wifiArray[0]} Mhz") + fi + done < $stationslist + rm -f $stationslist if [[ ${#LIST[@]} == 0 ]]; then restore_netplan_config else - SELECTED_SSID=$($DIALOG --title "Select SSID" --menu "rf" $((${LIST_LENGTH} + 6)) 50 $((${LIST_LENGTH})) "${LIST[@]}" 3>&1 1>&2 2>&3) + SELECTED_SSID=$($DIALOG --notags --backtitle "" --menu "Select WiFi Network" $((${#LIST[@]}/3 + 14 )) 70 $((${#LIST[@]}/3 + 6)) "${LIST[@]}" 3>&1 1>&2 2>&3) if [[ -n $SELECTED_SSID ]]; then SELECTED_PASSWORD=$($DIALOG --title "Enter new password for $SELECTED_SSID" --passwordbox "" 7 50 3>&1 1>&2 2>&3) if [[ -n $SELECTED_PASSWORD ]]; then diff --git a/tools/modules/software/install_openhab.sh b/tools/modules/software/install_openhab.sh index a21a9ead..eba73ef6 100644 --- a/tools/modules/software/install_openhab.sh +++ b/tools/modules/software/install_openhab.sh @@ -2,7 +2,7 @@ module_options+=( ["openhab,author"]="@igorpecovnik" ["openhab,ref_link"]="" - ["openhab,feature"]="install_openhab" + ["openhab,feature"]="openhab" ["openhab,desc"]="Install openhab from a repo using apt" ["openhab,example"]="install uinstall" ["openhab,status"]="Active" diff --git a/tools/modules/system/apt_install_wrapper.sh b/tools/modules/system/apt_install_wrapper.sh index 220e2d02..ec17db7b 100644 --- a/tools/modules/system/apt_install_wrapper.sh +++ b/tools/modules/system/apt_install_wrapper.sh @@ -2,7 +2,7 @@ module_options+=( ["apt_install_wrapper,author"]="@igorpecovnik" ["apt_install_wrapper,ref_link"]="" - ["apt_install_wrapper,feature"]="Install wrapper" + ["apt_install_wrapper,feature"]="apt_install_wrapper" ["apt_install_wrapper,desc"]="Install wrapper" ["apt_install_wrapper,example"]="apt_install_wrapper apt-get -y purge armbian-zsh" ["apt_install_wrapper,status"]="Active" diff --git a/tools/modules/system/manage_desktops.sh b/tools/modules/system/manage_desktops.sh index 4416fe81..5f2b0aa6 100644 --- a/tools/modules/system/manage_desktops.sh +++ b/tools/modules/system/manage_desktops.sh @@ -1,7 +1,7 @@ module_options+=( ["manage_desktops,author"]="@igorpecovnik" ["manage_desktops,ref_link"]="" - ["manage_desktops,feature"]="install_de" + ["manage_desktops,feature"]="manage_desktops" ["manage_desktops,desc"]="Install Desktop environment" ["manage_desktops,example"]="manage_desktops xfce install" ["manage_desktops,status"]="Active" diff --git a/tools/modules/system/manage_dtoverlays.sh b/tools/modules/system/manage_dtoverlays.sh index c402ec40..ba85ea7b 100644 --- a/tools/modules/system/manage_dtoverlays.sh +++ b/tools/modules/system/manage_dtoverlays.sh @@ -2,7 +2,7 @@ module_options+=( ["manage_dtoverlays,author"]="@viraniac" ["manage_dtoverlays,ref_link"]="" -["manage_dtoverlays,feature"]="dtoverlays" +["manage_dtoverlays,feature"]="manage_dtoverlays" ["manage_dtoverlays,desc"]="Enable/disable device tree overlays" ["manage_dtoverlays,example"]="manage_dtoverlays" ["manage_dtoverlays,status"]="Active" diff --git a/tools/modules/system/manage_odroid_board.sh b/tools/modules/system/manage_odroid_board.sh new file mode 100644 index 00000000..2d33568f --- /dev/null +++ b/tools/modules/system/manage_odroid_board.sh @@ -0,0 +1,44 @@ +module_options+=( + ["manage_odroid_board,author"]="@GeoffClements" + ["manage_odroid_board,ref_link"]="" + ["manage_odroid_board,feature"]="Odroid board" + ["manage_odroid_board,desc"]="Select optimised Odroid board configuration" + ["manage_odroid_board,example"]="select" + ["manage_odroid_board,status"]="Stable" +) +# +# @description Select optimised board configuration +# +function manage_odroid_board() { + + local board_list=("Odroid XU4" "Odroid XU3" "Odroid XU3 Lite" "Odroid HC1/HC2") + local board_id=("xu4" "xu3" "xu3l" "hc1") + local -a list + local state + + local env_file=/boot/armbianEnv.txt + local current_board=$(grep -oP '^board_name=\K.*' ${env_file}) + local target_board=${current_board} + + for board_num in $(seq 0 $((${#board_list[@]} - 1))); do + if [[ "${board_id[${board_num}]}" == "${current_board}" ]]; then + state=on + else + state=off + fi + list+=("${board_id[${board_num}]}" "${board_list[${board_num}]}" "${state}") + done + + if target_board=$($DIALOG --notags --title "Select optimised board configuration" \ + --radiolist "" 10 42 4 "${list[@]}" 3>&1 1>&2 2>&3); then + sed -i "s/^board_name=.*/board_name=${target_board}/" ${env_file} 2> /dev/null && \ + grep -q "^board_name=${target_board}" ${env_file} 2>/dev/null || \ + echo "board_name=${target_board}" >> ${env_file} + sed -i "s/^BOARD_NAME.*/BOARD_NAME=\"Odroid ${target_board^^}\"/" /etc/armbian-release + + if $DIALOG --title " Reboot required " --yes-button "Reboot" --no-button "Cancel" --yesno \ + "A reboot is required to apply the changes. Shall we reboot now?" 7 34; then + reboot + fi + fi +} diff --git a/tools/modules/system/manage_overlayfs.sh b/tools/modules/system/manage_overlayfs.sh index fa6abef6..bf9d8f05 100644 --- a/tools/modules/system/manage_overlayfs.sh +++ b/tools/modules/system/manage_overlayfs.sh @@ -1,7 +1,7 @@ module_options+=( ["manage_overlayfs,author"]="@igorpecovnik" ["manage_overlayfs,ref_link"]="" - ["manage_overlayfs,feature"]="overlayfs" + ["manage_overlayfs,feature"]="manage_overlayfs" ["manage_overlayfs,desc"]="Set Armbian root filesystem to read only" ["manage_overlayfs,example"]="manage_overlayfs enable/disable" ["manage_overlayfs,status"]="Active"