Skip to content

Commit

Permalink
Merge branch 'main' into Tearran-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tearran authored Dec 5, 2024
2 parents 89770f6 + ae2789f commit f4b2895
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 32 deletions.
53 changes: 34 additions & 19 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ sudo armbian-config
- ### ZFS filesystem - remove support


- ### Select Odroid board configuration




- ## **Network**
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -361,15 +365,15 @@ 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
--cmd CON002 - Install Docker Engine
--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
Expand All @@ -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
Expand Down Expand Up @@ -619,6 +623,16 @@ Jobs:
module_zfs remove
~~~
### SY020
Select Odroid board configuration
Jobs:
~~~
manage_odroid_board select
~~~
### NE001
Configure network interfaces
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tools/json/config.system.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]"
}
]
}
Expand Down
35 changes: 27 additions & 8 deletions tools/modules/network/network_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/software/install_openhab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/system/apt_install_wrapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/system/manage_desktops.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion tools/modules/system/manage_dtoverlays.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
44 changes: 44 additions & 0 deletions tools/modules/system/manage_odroid_board.sh
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion tools/modules/system/manage_overlayfs.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit f4b2895

Please sign in to comment.