diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index c40a8958..931ce434 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -114,6 +114,31 @@ sudo armbian-config - ### Remove hostname broadcast via mDNS (avahi-daemon) + - ### Download tools + - ### Install qBittorrent + - ### Remove qBittorrent + - ### Install Deluge + - ### Remove Deluge + - ### Install Transmission + - ### Remove Transmission + - ### Install SABnzbd + - ### Remove SABnzbd + - ### Install Medusa + - ### Remove Medusa + - ### Install Sonarr + - ### Remove Sonarr + - ### Install Radarr + - ### Remove Radarr + - ### Install Bazarr + - ### Remove Bazarr + - ### Install Lidarr + - ### Remove Lidarr + - ### Install Readarr + - ### Remove Readarr + - ### Install Prowlarr + - ### Remove Prowlarr + + - ### DNS blockers - ### Install Pi-hole DNS ad blocker - ### Set Pi-hole web admin password @@ -128,6 +153,8 @@ sudo armbian-config - ### Home Automation - ### Install openHAB - ### Remove openHAB + - ### Install Home Assistant + - ### Remove Home Assistant - ### System benchmaking and diagnostics @@ -252,6 +279,29 @@ Outputs: --cmd NET006 - Remove IP LAN monitor (iptraf-ng) --cmd NET007 - Install hostname broadcast via mDNS (avahi-daemon) --cmd NET008 - Remove hostname broadcast via mDNS (avahi-daemon) + Downloaders - Download tools + --cmd DOW001 - Install qBittorrent + --cmd DOW002 - Remove qBittorrent (http://10.1.0.7:8090 6881) + --cmd DOW003 - Install Deluge + --cmd DOW004 - Remove Deluge (http://10.1.0.7:8112 6181 58846) + --cmd DOW005 - Install Transmission + --cmd DOW006 - Remove Transmission (http://10.1.0.7:9091) + --cmd DOW011 - Install SABnzbd + --cmd DOW012 - Remove SABnzbd (http://10.1.0.7:8080) + --cmd DOW013 - Install Medusa + --cmd DOW014 - Remove Medusa (http://10.1.0.7:8081) + --cmd DOW015 - Install Sonarr + --cmd DOW016 - Remove Sonarr (http://10.1.0.7:8989) + --cmd DOW017 - Install Radarr + --cmd DOW018 - Remove Radarr (http://10.1.0.7:7878) + --cmd DOW019 - Install Bazarr + --cmd DOW020 - Remove Bazarr (http://10.1.0.7:6767) + --cmd DOW021 - Install Lidarr + --cmd DOW022 - Remove Lidarr (http://10.1.0.7:8686) + --cmd DOW023 - Install Readarr + --cmd DOW024 - Remove Readarr (http://10.1.0.7:8787) + --cmd DOW025 - Install Prowlarr + --cmd DOW026 - Remove Prowlarr (http://10.1.0.7:9696) DNS - DNS blockers --cmd DNS001 - Install Pi-hole DNS ad blocker --cmd DNS002 - Set Pi-hole web admin password @@ -262,6 +312,8 @@ Outputs: HomeAutomation - Home Automation --cmd HA001 - Install openHAB --cmd HA002 - Remove openHAB + --cmd HA003 - Install Home Assistant + --cmd HA004 - Remove Home Assistant (http://10.1.0.7:8123) --cmd Benchy - System benchmaking and diagnostics Containers - Containerlization and Virtual Machines --cmd CON001 - Install Docker Minimal @@ -269,7 +321,7 @@ Outputs: --cmd CON003 - Remove Docker --cmd CON004 - Purge all Docker images, containers, and volumes --cmd CON005 - Install Portainer - --cmd CON006 - Remove Portainer + --cmd CON006 - Remove Portainer (http://10.1.0.7:9000) Media - Media Servers and Editors --cmd MED001 - Install Plex Media server --cmd MED002 - Remove Plex Media server @@ -358,7 +410,7 @@ Install Linux headers Jobs: ~~~ -Headers_install +module_headers install ~~~ ### SY005 @@ -368,7 +420,7 @@ Remove Linux headers Jobs: ~~~ -Headers_remove +module_headers remove ~~~ ### SY006 @@ -544,6 +596,16 @@ Jobs: No commands available ~~~ +### Downloaders + +Download tools + +Jobs: + +~~~ +No commands available +~~~ + ### DNS DNS blockers @@ -652,11 +714,15 @@ These helper functions facilitate various operations related to job management, | Generate this markdown table of all module_options | see_function_table_md | @Tearran | Switching to alternative kernels | switch_kernels | @igorpecovnik | Webmin setup and service setting. | help install remove start stop enable disable status check | @Tearran +| Hos container install and configure | help install uninstall | @igorpecovnik | Set Armbian root filesystem to read only | manage_overlayfs enable/disable | @igorpecovnik | Display a menu from pipe | show_menu <<< armbianmonitor -h ; | @Tearran | Build the main menu from a object | generate_top_menu 'json_data' | @Tearran +| Install bazarr container | install remove status help | @igorpecovnik +| Install headers container | install remove status help | @armbian | Migrated procedures from Armbian config. | is_package_manager_running | @armbian | Migrated procedures from Armbian config. | check_desktop | @armbian +| Install sonarr container | install remove status help | @armbian | Generate Document files. | generate_readme | @Tearran | Storing netplan config to tmp | store_netplan_config | @igorpecovnik | Needed by generate_menu | execute_command 'id' | @Tearran @@ -667,33 +733,36 @@ These helper functions facilitate various operations related to job management, | Enable/disable device tree overlays | manage_dtoverlays | @viraniac | Show or generate QR code for Google OTP | qr_code generate | @igorpecovnik | Install/uninstall/check status of pi-hole container | help install uninstall status password | @armbian -| Check if kernel headers are installed | are_headers_installed | @viraniac | Check when apt list was last updated and suggest updating or update | see_current_apt or see_current_apt update | @Tearran | Install/uninstall/check status of portainer container | help install uninstall status | @armbian | Migrated procedures from Armbian config. | check_if_installed nano | @armbian | Generate 'Armbian CPU logo' SVG for document file. | generate_svg | @Tearran -| Remove Linux headers | Headers_remove | @Tearran | Update submenu descriptions based on conditions | update_submenu_data | @Tearran | sanitize input cli | sanitize_input | @Tearran +| Install lidarr container | install remove status help | @armbian | Check if a domain is reachable via IPv4 and IPv6 | check_ip_version google.com | @Tearran | Install embyserver from repo using apt | install_embyserver | @schwar3kat -| Migrated procedures from Armbian config. | set_header_remove | @igorpecovnik +| Install deluge container | install remove status help | @armbian | Generate a submenu from a parent_id | generate_menu 'parent_id' | @Tearran | Install docker from a repo using apt | install_docker engine | @schwar3kat | Generate a markdown list json objects using jq. | see_jq_menu_list | @Tearran | Generate jobs from JSON file. | generate_jobs_from_json | @Tearran -| Install kernel headers | is_package_manager_running | @Tearran +| Install radarr container | install remove status help | @armbian | Toggle IPv6 on or off | toggle_ipv6 | @Tearran | Adjust welcome screen (motd) | adjust_motd clear, header, sysinfo, tips, commands | @igorpecovnik +| Install qbittorrent container | install remove status help | @armbian | Generate JSON-like object file. | generate_json | @Tearran +| Install transmission container | install remove status help | @armbian | Install wrapper | apt_install_wrapper apt-get -y purge armbian-zsh | @igorpecovnik | Uses Avalible (Whiptail, DIALOG, READ) for the menu interface | | Tearran | Netplan wrapper | network_config | @igorpecovnik +| Install medusa container | install remove status help | @armbian | Change the background color of the terminal or dialog box | set_colors 0-7 | @Tearran | Show general information about this tool | about_armbian_configng | @igorpecovnik | Serve the edit and debug server. | serve_doc | @Tearran | Update JSON data with system information | update_json_data | @Tearran | pipeline strings to an infobox | show_infobox <<< 'hello world' ; | @Tearran +| Install readarr container | install remove status help | @armbian | Install/uninstall/check status of uptime kuma container | install uninstall status | @armbian | Stop hostapd, clean config | default_wireless_network_config | @igorpecovnik | Update sub-submenu descriptions based on conditions | update_sub_submenu_data "MenuID" "SubID" "SubSubID" "CMD" | @Tearran @@ -701,8 +770,10 @@ These helper functions facilitate various operations related to job management, | Show the usage of the functions. | see_use | @Tearran | Install Desktop environment | manage_desktops xfce install | @igorpecovnik | Set system shell to BASH | manage_zsh enable|disable | @igorpecovnik +| Install sabnzbd container | install remove status help | @armbian | Generate a Help message for cli commands. | see_cmd_list [category] | @Tearran | Revert network config back to Armbian defaults | default_network_config | @igorpecovnik +| Install prowlarr container | install remove status help | @armbian | freeze, unhold, reinstall armbian related packages. | armbian_fw_manipulate unhold/freeze/reinstall | @igorpecovnik | Check the internet connection with fallback DNS | see_ping | @Tearran | Upgrade to next stable or rolling release | release_upgrade stable verify | @igorpecovnik diff --git a/tools/include/images/DOW001.png b/tools/include/images/DOW001.png new file mode 100644 index 00000000..fb57111b Binary files /dev/null and b/tools/include/images/DOW001.png differ diff --git a/tools/include/images/DOW003.png b/tools/include/images/DOW003.png new file mode 100644 index 00000000..3a00477e Binary files /dev/null and b/tools/include/images/DOW003.png differ diff --git a/tools/include/images/DOW005.png b/tools/include/images/DOW005.png new file mode 100644 index 00000000..28ad1c90 Binary files /dev/null and b/tools/include/images/DOW005.png differ diff --git a/tools/include/images/DOW011.png b/tools/include/images/DOW011.png new file mode 100644 index 00000000..0908c391 Binary files /dev/null and b/tools/include/images/DOW011.png differ diff --git a/tools/include/images/DOW013.png b/tools/include/images/DOW013.png new file mode 100644 index 00000000..603e731d Binary files /dev/null and b/tools/include/images/DOW013.png differ diff --git a/tools/include/images/DOW015.png b/tools/include/images/DOW015.png new file mode 100644 index 00000000..22932894 Binary files /dev/null and b/tools/include/images/DOW015.png differ diff --git a/tools/include/images/DOW017.png b/tools/include/images/DOW017.png new file mode 100644 index 00000000..48d8e5b3 Binary files /dev/null and b/tools/include/images/DOW017.png differ diff --git a/tools/include/images/DOW019.png b/tools/include/images/DOW019.png new file mode 100644 index 00000000..2f4707b1 Binary files /dev/null and b/tools/include/images/DOW019.png differ diff --git a/tools/include/images/DOW021.png b/tools/include/images/DOW021.png new file mode 100644 index 00000000..33bed87e Binary files /dev/null and b/tools/include/images/DOW021.png differ diff --git a/tools/include/images/DOW023.png b/tools/include/images/DOW023.png new file mode 100644 index 00000000..37df9ae3 Binary files /dev/null and b/tools/include/images/DOW023.png differ diff --git a/tools/include/images/DOW025.png b/tools/include/images/DOW025.png new file mode 100644 index 00000000..d4bb74e2 Binary files /dev/null and b/tools/include/images/DOW025.png differ diff --git a/tools/include/images/HA003.png b/tools/include/images/HA003.png new file mode 100644 index 00000000..61fbbf86 Binary files /dev/null and b/tools/include/images/HA003.png differ diff --git a/tools/include/markdown/DOW001-footer.md b/tools/include/markdown/DOW001-footer.md new file mode 100644 index 00000000..626e6c8a --- /dev/null +++ b/tools/include/markdown/DOW001-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8090**: + + - URL: `https://:8090` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/qbittorrent` + - Site configuration directory: `/armbian/qbittorrent/config` + - Download directory: `/armbian/qbittorrent/downloads` + +=== "View logs" + + ```sh + docker logs -f qbittorrent + ``` diff --git a/tools/include/markdown/DOW001-header.md b/tools/include/markdown/DOW001-header.md new file mode 100644 index 00000000..a11d08bb --- /dev/null +++ b/tools/include/markdown/DOW001-header.md @@ -0,0 +1 @@ +The Qbittorrent⁠ project aims to provide an open-source software alternative to µTorrent. qBittorrent is based on the Qt toolkit and libtorrent-rasterbar library. diff --git a/tools/include/markdown/DOW003-footer.md b/tools/include/markdown/DOW003-footer.md new file mode 100644 index 00000000..9bf3cf70 --- /dev/null +++ b/tools/include/markdown/DOW003-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8112**: + + - URL: `https://:8112` + - Username/Password: default user/password of admin/deluge + +=== "Directories" + + - Install directory: `/armbian/deluge` + - Site configuration directory: `/armbian/deluge/config` + - Download directory: `/armbian/deluge/downloads` + +=== "View logs" + + ```sh + docker logs -f deluge + ``` diff --git a/tools/include/markdown/DOW003-header.md b/tools/include/markdown/DOW003-header.md new file mode 100644 index 00000000..7019214b --- /dev/null +++ b/tools/include/markdown/DOW003-header.md @@ -0,0 +1 @@ +Deluge⁠ is a lightweight, Free Software, cross-platform BitTorrent client. diff --git a/tools/include/markdown/DOW005-footer.md b/tools/include/markdown/DOW005-footer.md new file mode 100644 index 00000000..99c69c77 --- /dev/null +++ b/tools/include/markdown/DOW005-footer.md @@ -0,0 +1,19 @@ +=== "Access to the web interface" + + The web interface is accessible via port **9091**: + + - URL: `https://:9091` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/transmission` + - Site configuration directory: `/armbian/transmission/config` + - Download directory: `/armbian/transmission/downloads` + - Watch directory: `/armbian/transmission/watch` + +=== "View logs" + + ```sh + docker logs -f transmission + ``` diff --git a/tools/include/markdown/DOW005-header.md b/tools/include/markdown/DOW005-header.md new file mode 100644 index 00000000..91bad2ad --- /dev/null +++ b/tools/include/markdown/DOW005-header.md @@ -0,0 +1 @@ +Transmission⁠ is designed for easy, powerful use. Transmission has the features you want from a BitTorrent client: encryption, a web interface, peer exchange, magnet links, DHT, µTP, UPnP and NAT-PMP port forwarding, webseed support, watch directories, tracker editing, global and per-torrent speed limits, and more. diff --git a/tools/include/markdown/DOW011-footer.md b/tools/include/markdown/DOW011-footer.md new file mode 100644 index 00000000..32cc4268 --- /dev/null +++ b/tools/include/markdown/DOW011-footer.md @@ -0,0 +1,19 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8080**: + + - URL: `https://:8080` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/sabnzbd` + - Site configuration directory: `/armbian/sabnzbd/config` + - Download directory: `/armbian/sabnzbd/downloads` + - Incomplete downloads: `/armbian/sabnzbd/incomplete` + +=== "View logs" + + ```sh + docker logs -f sabnzbd + ``` diff --git a/tools/include/markdown/DOW011-header.md b/tools/include/markdown/DOW011-header.md new file mode 100644 index 00000000..36152136 --- /dev/null +++ b/tools/include/markdown/DOW011-header.md @@ -0,0 +1 @@ +Sabnzbd⁠ makes Usenet as simple and streamlined as possible by automating everything we can. All you have to do is add an .nzb. SABnzbd takes over from there, where it will be automatically downloaded, verified, repaired, extracted and filed away with zero human interaction. diff --git a/tools/include/markdown/DOW013-footer.md b/tools/include/markdown/DOW013-footer.md new file mode 100644 index 00000000..52d78f50 --- /dev/null +++ b/tools/include/markdown/DOW013-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8081**: + + - URL: `https://:8081` + +=== "Directories" + + - Install directory: `/armbian/medusa` + - Site configuration directory: `/armbian/medusa/config` + - Download directory: `/armbian/medusa/downloads` + - Download directory TV shows: `/armbian/medusa/downloads/tv` + +=== "View logs" + + ```sh + docker logs -f medusa + ``` diff --git a/tools/include/markdown/DOW013-header.md b/tools/include/markdown/DOW013-header.md new file mode 100644 index 00000000..9c0c09a9 --- /dev/null +++ b/tools/include/markdown/DOW013-header.md @@ -0,0 +1 @@ +Medusa is an automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic. diff --git a/tools/include/markdown/DOW015-footer.md b/tools/include/markdown/DOW015-footer.md new file mode 100644 index 00000000..5bebc6ea --- /dev/null +++ b/tools/include/markdown/DOW015-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8989**: + + - URL: `https://:8989` + +=== "Directories" + + - Install directory: `/armbian/sonarr` + - Site configuration directory: `/armbian/sonarr/config` + - Download directory: `/armbian/sonarr/tvseries` + - Client download directory: `/armbian/sonarr/client` + +=== "View logs" + + ```sh + docker logs -f sonarr + ``` diff --git a/tools/include/markdown/DOW015-header.md b/tools/include/markdown/DOW015-header.md new file mode 100644 index 00000000..5ef191da --- /dev/null +++ b/tools/include/markdown/DOW015-header.md @@ -0,0 +1 @@ +Sonarr (formerly NZBdrone) is a PVR for usenet and bittorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. diff --git a/tools/include/markdown/DOW017-footer.md b/tools/include/markdown/DOW017-footer.md new file mode 100644 index 00000000..ac3a76b9 --- /dev/null +++ b/tools/include/markdown/DOW017-footer.md @@ -0,0 +1,19 @@ +=== "Access to the web interface" + + The web interface is accessible via port **7878**: + + - URL: `https://:7878` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/radarr` + - Site configuration directory: `/armbian/radarr/config` + - Download directory: `/armbian/radarr/movies` + - Client download directory: `/armbian/radarr/client` + +=== "View logs" + + ```sh + docker logs -f radarr + ``` diff --git a/tools/include/markdown/DOW017-header.md b/tools/include/markdown/DOW017-header.md new file mode 100644 index 00000000..811e2cd9 --- /dev/null +++ b/tools/include/markdown/DOW017-header.md @@ -0,0 +1 @@ +Radarr - A fork of Sonarr to work with movies à la Couchpotato. diff --git a/tools/include/markdown/DOW019-footer.md b/tools/include/markdown/DOW019-footer.md new file mode 100644 index 00000000..5dc22e59 --- /dev/null +++ b/tools/include/markdown/DOW019-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **6767**: + + - URL: `https://:6767` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/bazarr` + - Site configuration directory: `/armbian/bazarr/config` + - Download directory: `/armbian/bazarr/movies` `/armbian/bazarr/tv` + +=== "View logs" + + ```sh + docker logs -f bazarr + ``` diff --git a/tools/include/markdown/DOW019-header.md b/tools/include/markdown/DOW019-header.md new file mode 100644 index 00000000..d0752f39 --- /dev/null +++ b/tools/include/markdown/DOW019-header.md @@ -0,0 +1 @@ +Bazarr is a companion application to Sonarr and Radarr. It can manage and download subtitles based on your requirements. You define your preferences by TV show or movie and Bazarr takes care of everything for you. diff --git a/tools/include/markdown/DOW021-footer.md b/tools/include/markdown/DOW021-footer.md new file mode 100644 index 00000000..02d7fbea --- /dev/null +++ b/tools/include/markdown/DOW021-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8686**: + + - URL: `https://:8686` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/lidarr` + - Site configuration directory: `/armbian/lidarr/config` + - Download directory: `/armbian/lidarr/downloads` `/armbian/lidarr/music` + +=== "View logs" + + ```sh + docker logs -f lidarr + ``` diff --git a/tools/include/markdown/DOW021-header.md b/tools/include/markdown/DOW021-header.md new file mode 100644 index 00000000..18b688a7 --- /dev/null +++ b/tools/include/markdown/DOW021-header.md @@ -0,0 +1 @@ +Lidarr is a music collection manager for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new tracks from your favorite artists and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available. diff --git a/tools/include/markdown/DOW023-footer.md b/tools/include/markdown/DOW023-footer.md new file mode 100644 index 00000000..1efa7801 --- /dev/null +++ b/tools/include/markdown/DOW023-footer.md @@ -0,0 +1,18 @@ +=== "Access to the web interface" + + The web interface is accessible via port **8787**: + + - URL: `https://:8787` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/readarr` + - Site configuration directory: `/armbian/readarr/config` + - Download directory: `/armbian/readarr/books` `/armbian/readarr/client` + +=== "View logs" + + ```sh + docker logs -f readarr + ``` diff --git a/tools/include/markdown/DOW023-header.md b/tools/include/markdown/DOW023-header.md new file mode 100644 index 00000000..6344c987 --- /dev/null +++ b/tools/include/markdown/DOW023-header.md @@ -0,0 +1 @@ +Readarr - Book Manager and Automation (Sonarr for Ebooks) diff --git a/tools/include/markdown/DOW025-footer.md b/tools/include/markdown/DOW025-footer.md new file mode 100644 index 00000000..816a9c6e --- /dev/null +++ b/tools/include/markdown/DOW025-footer.md @@ -0,0 +1,17 @@ +=== "Access to the web interface" + + The web interface is accessible via port **9696**: + + - URL: `https://:9696` + - Username/Password: admin / generate at first web interface login + +=== "Directories" + + - Install directory: `/armbian/prowlarr` + - Site configuration directory: `/armbian/prowlarr/config` + +=== "View logs" + + ```sh + docker logs -f prowlarr + ``` diff --git a/tools/include/markdown/DOW025-header.md b/tools/include/markdown/DOW025-header.md new file mode 100644 index 00000000..b19b8fd9 --- /dev/null +++ b/tools/include/markdown/DOW025-header.md @@ -0,0 +1 @@ +Prowlarr is a indexer manager/proxy built on the popular arr .net/reactjs base stack to integrate with your various PVR apps. Prowlarr supports both Torrent Trackers and Usenet Indexers. It integrates seamlessly with Sonarr, Radarr, Lidarr, and Readarr offering complete management of your indexers with no per app Indexer setup required (we do it all). diff --git a/tools/include/markdown/HA003-footer.md b/tools/include/markdown/HA003-footer.md new file mode 100644 index 00000000..7d9985d5 --- /dev/null +++ b/tools/include/markdown/HA003-footer.md @@ -0,0 +1,10 @@ +|Functionality|HAOS|Armbian with HA| +|:--|:--:|:--:| +|Automations|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|Dashboards|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|Integrations|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|Add-ons|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|One-click updates|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|Backups|:heavy_check_mark:|:heavy_check_mark:|:heavy_check_mark:| +|General purpose server|:x:|:white_check_mark:| +|Running on exotic hardware|:x:|:white_check_mark:| \ No newline at end of file diff --git a/tools/include/markdown/HA003-header.md b/tools/include/markdown/HA003-header.md new file mode 100644 index 00000000..302d24f4 --- /dev/null +++ b/tools/include/markdown/HA003-header.md @@ -0,0 +1,16 @@ +Home Assistant is an open source smart home platform that allows you to connect your smart home devices like your TV, fan, cameras, thermostats, lights, and sensors. As a user, you can build intricate automation using Home Assistant's user-friendly, unified web-based user interface. + +Perfect to run on any single board computer with 4 cores and at least 512Mb of memory. Armbian installation is optimised to run from SD/eMMC media, but it is recommended to use SSD. + +=== "Access to the web interface" + + The web interface is accessible via port **8123**: + + - URL: `https://:8123` + - Username/Password: Are set at first web interface login + +=== "Directories" + + Home Assistant on Armbian runs supervised in a Docker container. This secures same functionality as stock HAOS. + + - Config directory: `/usr/share/haos` diff --git a/tools/include/markdown/NE002-footer.md b/tools/include/markdown/NE002-footer.md new file mode 100644 index 00000000..6d7131af --- /dev/null +++ b/tools/include/markdown/NE002-footer.md @@ -0,0 +1,23 @@ +=== "Wired device check" + + In order to configure your network devices, they need to be supported the kernel. + + To verify, use command: + + ```sh + ip addr + ``` + + It is usually something like eth0, enp4s3 or lan. + +=== "Wireless device check" + + In order to configure your wireless network devices, they need to be supported the kernel. + + To verify, use command: + + ```sh + iw dev | awk '$1=="Interface"{print $2}' + ``` + + It is usually something like `wlan0`, `wlo1` or `wlx12334c47dec3`. If you get blank response, it means your WiFi device / dongle is not supported by the kernel. diff --git a/tools/include/markdown/NE002-header.md b/tools/include/markdown/NE002-header.md new file mode 100644 index 00000000..6793baf1 --- /dev/null +++ b/tools/include/markdown/NE002-header.md @@ -0,0 +1,13 @@ +``` mermaid +graph LR + A[Network] --> B[Add / Change interface]; + A[Network] --> O[Revert to defaults]; + A[Network] --> P[Show configuration]; + B ---->E[Wired]; + B ---->F[Wireless]; + E -->R[DHCP]; + E -->T[Static]; + E -->S[Spoof MAC]; + F -->X[Station]; + F -->W[Access point]; +``` diff --git a/tools/json/config.software.json b/tools/json/config.software.json index 95a54f41..b270d9c0 100644 --- a/tools/json/config.software.json +++ b/tools/json/config.software.json @@ -357,6 +357,232 @@ } ] }, + { + "id": "Downloaders", + "description": "Download tools", + "sub": [ + { + "id": "DOW001", + "description": "Install qBittorrent", + "command": [ + "module_qbittorrent install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_qbittorrent status" + }, + { + "id": "DOW002", + "description": "Remove qBittorrent", + "command": [ + "module_qbittorrent remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_qbittorrent status" + }, + { + "id": "DOW003", + "description": "Install Deluge", + "command": [ + "module_deluge install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_deluge status" + }, + { + "id": "DOW004", + "description": "Remove Deluge", + "command": [ + "module_deluge remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_deluge status" + }, + { + "id": "DOW005", + "description": "Install Transmission", + "command": [ + "module_transmission install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_transmission status" + }, + { + "id": "DOW006", + "description": "Remove Transmission", + "command": [ + "module_transmission remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_transmission status" + }, + { + "id": "DOW011", + "description": "Install SABnzbd", + "command": [ + "module_sabnzbd install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sabnzbd status" + }, + { + "id": "DOW012", + "description": "Remove SABnzbd", + "command": [ + "module_sabnzbd remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sabnzbd status" + }, + { + "id": "DOW013", + "description": "Install Medusa", + "command": [ + "module_medusa install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_medusa status" + }, + { + "id": "DOW014", + "description": "Remove Medusa", + "command": [ + "module_medusa remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_medusa status" + }, + { + "id": "DOW015", + "description": "Install Sonarr", + "command": [ + "module_sonarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_sonarr status" + }, + { + "id": "DOW016", + "description": "Remove Sonarr", + "command": [ + "module_sonarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_sonarr status" + }, + { + "id": "DOW017", + "description": "Install Radarr", + "command": [ + "module_radarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_radarr status" + }, + { + "id": "DOW018", + "description": "Remove Radarr", + "command": [ + "module_radarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_radarr status" + }, + { + "id": "DOW019", + "description": "Install Bazarr", + "command": [ + "module_bazarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_bazarr status" + }, + { + "id": "DOW020", + "description": "Remove Bazarr", + "command": [ + "module_bazarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_bazarr status" + }, + { + "id": "DOW021", + "description": "Install Lidarr", + "command": [ + "module_lidarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_lidarr status" + }, + { + "id": "DOW022", + "description": "Remove Lidarr", + "command": [ + "module_lidarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_lidarr status" + }, + { + "id": "DOW023", + "description": "Install Readarr", + "command": [ + "module_readarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_readarr status" + }, + { + "id": "DOW024", + "description": "Remove Readarr", + "command": [ + "module_readarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_readarr status" + }, + { + "id": "DOW025", + "description": "Install Prowlarr", + "command": [ + "module_prowlarr install" + ], + "status": "Stable", + "author": "@armbian", + "condition": "! module_prowlarr status" + }, + { + "id": "DOW026", + "description": "Remove Prowlarr", + "command": [ + "module_prowlarr remove" + ], + "status": "Stable", + "author": "@armbian", + "condition": "module_prowlarr status" + } + ] + }, { "id": "DNS", "description": "DNS blockers", @@ -444,6 +670,26 @@ "status": "Stable", "author": "@armbian", "condition": "check_if_installed openhab" + }, + { + "id": "HA003", + "description": "Install Home Assistant", + "command": [ + "module_haos install" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "! check_if_installed homeassistant-supervised && grep -q bookworm /etc/os-release" + }, + { + "id": "HA004", + "description": "Remove Home Assistant", + "command": [ + "module_haos uninstall" + ], + "status": "Preview", + "author": "@igorpecovnik", + "condition": "check_if_installed homeassistant-supervised" } ] }, diff --git a/tools/json/config.system.json b/tools/json/config.system.json index 5cb09ae8..675afc6d 100644 --- a/tools/json/config.system.json +++ b/tools/json/config.system.json @@ -41,21 +41,21 @@ "id": "SY004", "description": "Install Linux headers", "command": [ - "Headers_install" + "module_headers install" ], - "status": "Preview", - "author": "@Tearran", - "condition": "! are_headers_installed" + "status": "Stable", + "author": "@igorpecovnik", + "condition": "! module_headers status" }, { "id": "SY005", "description": "Remove Linux headers", "command": [ - "Headers_remove" + "module_headers remove" ], - "status": "Preview", - "author": "@Tearran", - "condition": "are_headers_installed" + "status": "Stable", + "author": "@igorpecovnik", + "condition": "module_headers status" }, { "id": "SY006", @@ -65,7 +65,7 @@ ], "status": "Preview", "author": "@igorpecovnik", - "condition": "[[ -f /sbin/armbian-install ]]" + "condition": "[[ -f /sbin/armbian-install || -f /usr/bin/armbian-install ]]" }, { "id": "SY007", @@ -331,7 +331,7 @@ ], "status": "Stable", "author": "@viraniac @igorpecovnik", - "condition": "[ -d /boot/dtb/ ]" + "condition": "[ -d /boot/dtb/ ] && [ -f /boot/armbianEnv.txt ]" } ] } diff --git a/tools/modules/functions/set_runtime_variables.sh b/tools/modules/functions/set_runtime_variables.sh index 26d381ad..64d82043 100644 --- a/tools/modules/functions/set_runtime_variables.sh +++ b/tools/modules/functions/set_runtime_variables.sh @@ -54,6 +54,7 @@ function set_runtime_variables() { DISTROID=$(lsb_release -sc) KERNELID=$(uname -r) [[ -z "${ARMBIAN// /}" ]] && ARMBIAN="$DISTRO $DISTROID" + SOFTWARE_FOLDER="/armbian" # where we should keep 3rd party software DEFAULT_ADAPTER=$(ip -4 route ls | grep default | tail -1 | grep -Po '(?<=dev )(\S+)') LOCALIPADD=$(ip -4 addr show dev $DEFAULT_ADAPTER | awk '/inet/ {print $2}' | cut -d'/' -f1) BACKTITLE="Contribute: https://github.com/armbian/configng" diff --git a/tools/modules/network/network_config.sh b/tools/modules/network/network_config.sh index 223bf394..774fe84f 100644 --- a/tools/modules/network/network_config.sh +++ b/tools/modules/network/network_config.sh @@ -58,8 +58,11 @@ function network_config() { ip link set ${adapter} up default_wireless_network_config "${yamlfile}" "${adapter}" LIST=() - 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 1 + 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)) if [[ ${#LIST[@]} == 0 ]]; then restore_netplan_config diff --git a/tools/modules/runtime/config.runtime.sh b/tools/modules/runtime/config.runtime.sh index c600d5bc..77d72fc3 100644 --- a/tools/modules/runtime/config.runtime.sh +++ b/tools/modules/runtime/config.runtime.sh @@ -96,3 +96,20 @@ update_sub_submenu_data "Software" "Media" "SW24" "https://localhost:$emby_media plex_media_port="$(lsof -i -P -n | grep TCP | grep LISTEN | grep 'plex' | awk -F: '{print $2}' | awk '{print $1}' | head -n 1)" update_sub_submenu_data "Software" "Media" "SW22" "https://localhost:$plex_media_port" + +update_sub_submenu_data "Software" "Containers" "CON006" "http://$LOCALIPADD:${module_options["module_portainer,port"]}" +update_sub_submenu_data "Software" "HomeAutomation" "HA004" "http://$LOCALIPADD:${module_options["module_haos,port"]}" + + +update_sub_submenu_data "Software" "Downloaders" "DOW002" "http://$LOCALIPADD:${module_options["module_qbittorrent,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW004" "http://$LOCALIPADD:${module_options["module_deluge,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW006" "http://$LOCALIPADD:${module_options["module_transmission,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW012" "http://$LOCALIPADD:${module_options["module_sabnzbd,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW014" "http://$LOCALIPADD:${module_options["module_medusa,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW016" "http://$LOCALIPADD:${module_options["module_sonarr,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW018" "http://$LOCALIPADD:${module_options["module_radarr,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW020" "http://$LOCALIPADD:${module_options["module_bazarr,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW022" "http://$LOCALIPADD:${module_options["module_lidarr,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW024" "http://$LOCALIPADD:${module_options["module_readarr,port"]}" +update_sub_submenu_data "Software" "Downloaders" "DOW026" "http://$LOCALIPADD:${module_options["module_prowlarr,port"]}" + diff --git a/tools/modules/software/install_bazarr.sh b/tools/modules/software/install_bazarr.sh new file mode 100644 index 00000000..b1c417b4 --- /dev/null +++ b/tools/modules/software/install_bazarr.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_bazarr,author"]="@igorpecovnik" + ["module_bazarr,feature"]="module_bazarr" + ["module_bazarr,desc"]="Install bazarr container" + ["module_bazarr,example"]="install remove status help" + ["module_bazarr,port"]="6767" + ["module_bazarr,status"]="Active" + ["module_bazarr,arch"]="x86-64,arm64" +) +# +# Module Bazarr +# +function module_bazarr () { + local title="bazarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/bazarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/bazarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_bazarr,example"]}" + + BAZARR_BASE="${SOFTWARE_FOLDER}/bazarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$BAZARR_BASE" ]] || mkdir -p "$BAZARR_BASE" || { echo "Couldn't create storage directory: $BAZARR_BASE"; exit 1; } + docker run -d \ + --name=bazarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ=Etc/UTC \ + -p 6767:6767 \ + -v "${BAZARR_BASE}/config:/config" \ + -v "${BAZARR_BASE}/movies:/movies" `#optional` \ + -v "${BAZARR_BASE}/tv:/tv" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/bazarr:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' bazarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs bazarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${BAZARR_BASE}" && "${BAZARR_BASE}" != "/" ]] && rm -rf "${BAZARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_bazarr,feature"]} " + echo -e "Commands: ${module_options["module_bazarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_bazarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_deluge.sh b/tools/modules/software/install_deluge.sh new file mode 100644 index 00000000..4efff7d5 --- /dev/null +++ b/tools/modules/software/install_deluge.sh @@ -0,0 +1,82 @@ +module_options+=( + ["module_deluge,author"]="@armbian" + ["module_deluge,feature"]="module_deluge" + ["module_deluge,desc"]="Install deluge container" + ["module_deluge,example"]="install remove status help" + ["module_deluge,port"]="8112 6181 58846" + ["module_deluge,status"]="Active" + ["module_deluge,arch"]="x86-64,arm64" +) +# +# Module deluge +# +function module_deluge () { + local title="deluge" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/deluge?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/deluge?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_deluge,example"]}" + + DELUGE_BASE="${SOFTWARE_FOLDER}/deluge" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$DELUGE_BASE" ]] || mkdir -p "$DELUGE_BASE" || { echo "Couldn't create storage directory: $DELUGE_BASE"; exit 1; } + docker run -d \ + --name=deluge \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -e DELUGE_LOGLEVEL=error `#optional` \ + -p 8112:8112 \ + -p 6181:6881 \ + -p 6181:6881/udp \ + -p 58846:58846 `#optional` \ + -v "${DELUGE_BASE}/config:/config" \ + -v "${DELUGE_BASE}/downloads:/downloads" \ + --restart unless-stopped \ + lscr.io/linuxserver/deluge:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' deluge >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs deluge\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${DELUGE_BASE}" && "${DELUGE_BASE}" != "/" ]] && rm -rf "${DELUGE_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_deluge,feature"]} " + echo -e "Commands: ${module_options["module_deluge,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_deluge,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_docker.sh b/tools/modules/software/install_docker.sh index 8e25be18..d0b33cfc 100644 --- a/tools/modules/software/install_docker.sh +++ b/tools/modules/software/install_docker.sh @@ -31,8 +31,6 @@ install_docker() { fi systemctl enable docker.service > /dev/null 2>&1 systemctl enable containerd.service > /dev/null 2>&1 - $DIALOG --msgbox "To test that Docker has installed successfully -run the following command: docker run hello-world" 9 70 fi else $DIALOG --msgbox "ERROR ! ${DISTRO} $DISTROID distribution not found in repository!" 7 70 diff --git a/tools/modules/software/install_haos.sh b/tools/modules/software/install_haos.sh new file mode 100644 index 00000000..4d8725cc --- /dev/null +++ b/tools/modules/software/install_haos.sh @@ -0,0 +1,149 @@ +declare -A module_options +module_options+=( + ["module_haos,author"]="@igorpecovnik" + ["module_haos,feature"]="module_haos" + ["module_haos,example"]="help install uninstall" + ["module_haos,desc"]="Hos container install and configure" + ["module_haos,port"]="8123" + ["module_haos,status"]="review" +) +# +# Install haos container +# +module_haos() { + + + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/home-assistant/{print $1}') + local image=$(docker image ls -a | mawk '/home-assistant/{print $3}') + fi + + # Convert the example string to an array + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_haos,example"]}" + + case "$1" in + "${commands[0]}") + ## help/menu options for the module + echo -e "\nUsage: ${module_options["module_haos,feature"]} " + echo -e "Commands: ${module_options["module_haos,example"]}" + echo "Available commands:" + if [[ "${container}" ]] || [[ "${image}" ]]; then + echo -e "\tstatus\t- Show the status of the $title service." + echo -e "\tremove\t- Remove $title." + else + echo -e " install\t- Install $title." + fi + echo + ;; + install) + check_if_installed docker-ce || install_docker + + # this hack will allow running it on minimal image, but this has to be done properly in the network section, to allow easy switching + systemctl disable systemd-networkd + + # hack to force install + sed -i 's/^PRETTY_NAME=".*/PRETTY_NAME="Debian GNU\/Linux 12 (bookworm)"/g' "${SDCARD}/etc/os-release" + + # we host packages at our repository and version for both is determined: + # https://github.com/armbian/os/blob/main/external/haos-agent.conf + # https://github.com/armbian/os/blob/main/external/haos-supervised-installer.conf + + apt_install_wrapper apt-get -y install --download-only homeassistant-supervised os-agent + + # determine machine type + case "${ARCH}" in + armhf) MACHINE="tinker";; + amd64) MACHINE="generic-x86-64";; + arm64) MACHINE="odroid-n2";; + *) exit 1;; + esac + + # this we can't put behind wrapper + MACHINE="${MACHINE}" apt-get -y install homeassistant-supervised os-agent + + # workarounding supervisor loosing healthy state https://github.com/home-assistant/supervisor/issues/4381 + cat <<- SUPERVISOR_FIX > "/usr/local/bin/supervisor_fix.sh" + #!/bin/bash + while true; do + if ha supervisor info 2>&1 | grep -q "healthy: false"; then + echo "Unhealthy detected, restarting" | systemd-cat -t $(basename "$0") -p debug + systemctl restart hassio-supervisor.service + sleep 600 + else + sleep 5 + fi + done + SUPERVISOR_FIX + + # add executable bit + chmod +x "/usr/local/bin/supervisor_fix.sh" + + # generate service file to run this script + cat <<- SUPERVISOR_FIX_SERVICE > "/etc/systemd/system/supervisor-fix.service" + [Unit] + Description=Supervisor Unhealthy Fix + + [Service] + StandardOutput=null + StandardError=null + ExecStart=/usr/local/bin/supervisor_fix.sh + + [Install] + WantedBy=multi-user.target + SUPERVISOR_FIX_SERVICE + + if [[ -f /boot/armbianEnv.txt ]]; then + echo "extraargs=systemd.unified_cgroup_hierarchy=0 apparmor=1 security=apparmor" >> "/boot/armbianEnv.txt" + fi + sleep 5 + for s in {1..10};do + for i in {0..100..10}; do + j=$i + echo "$i" + sleep 1 + done + if [[ -n "$(docker container ls -a | mawk '/hassio-cli/{print $1}')" ]]; then + ha supervisor info --raw-json >/dev/null + if [[ $status -ne 0 ]]; then break; fi + fi + done | $DIALOG --gauge "Preparing Home Assistant Supervised\n\nPlease wait! " 10 50 0 + + # enable service + systemctl enable supervisor-fix >/dev/null 2>&1 + systemctl start supervisor-fix >/dev/null 2>&1 + + # restore os-release + sed -i "s/^PRETTY_NAME=\".*/PRETTY_NAME=\"${VENDOR} ${REVISION} ($VERSION_CODENAME)\"/g" "/etc/os-release" + + # show that its done + $DIALOG --msgbox "Home assistant is available at\n\nhttps://${LOCALIPADD}:8123 " 10 38 + ;; + uninstall) + # disable service + systemctl disable supervisor-fix >/dev/null 2>&1 + systemctl stop supervisor-fix >/dev/null 2>&1 + apt_install_wrapper apt-get -y purge homeassistant-supervised os-agent + echo -e "Removing Home Assistant containers.\n\nPlease wait few minutes! " + if [[ "${container}" ]]; then + echo "${container}" | xargs docker stop >/dev/null 2>&1 + echo "${container}" | xargs docker rm >/dev/null 2>&1 + fi + if [[ "${image}" ]]; then + echo "${image}" | xargs docker image rm >/dev/null 2>&1 + fi + rm -f /usr/local/bin/supervisor_fix.sh + rm -f /etc/systemd/system/supervisor-fix.service + sed -i "s/ systemd.unified_cgroup_hierarchy=0 apparmor=1 security=apparmor//" /boot/armbianEnv.txt + systemctl daemon-reload >/dev/null 2>&1 + # restore os-release + sed -i "s/^PRETTY_NAME=\".*/PRETTY_NAME=\"${VENDOR} ${REVISION} ($VERSION_CODENAME)\"/g" "/etc/os-release" + ;; + status) + [[ "${container}" ]] || [[ "${image}" ]] && return 0 + ;; + esac +} + +module_haos "$1" diff --git a/tools/modules/software/install_lidarr.sh b/tools/modules/software/install_lidarr.sh new file mode 100644 index 00000000..c0c2c3a7 --- /dev/null +++ b/tools/modules/software/install_lidarr.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_lidarr,author"]="@armbian" + ["module_lidarr,feature"]="module_lidarr" + ["module_lidarr,desc"]="Install lidarr container" + ["module_lidarr,example"]="install remove status help" + ["module_lidarr,port"]="8686" + ["module_lidarr,status"]="Active" + ["module_lidarr,arch"]="x86-64,arm64" +) +# +# Module lidarr +# +function module_lidarr () { + local title="lidarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/lidarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/lidarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_lidarr,example"]}" + + LIDARR_BASE="${SOFTWARE_FOLDER}/lidarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$LIDARR_BASE" ]] || mkdir -p "$LIDARR_BASE" || { echo "Couldn't create storage directory: $LIDARR_BASE"; exit 1; } + docker run -d \ + --name=lidarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 8686:8686 \ + -v "${LIDARR_BASE}/config:/config" \ + -v "${LIDARR_BASE}/music:/music" `#optional` \ + -v "${LIDARR_BASE}/downloads:/downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/lidarr:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' lidarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs lidarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${LIDARR_BASE}" && "${LIDARR_BASE}" != "/" ]] && rm -rf "${LIDARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_lidarr,feature"]} " + echo -e "Commands: ${module_options["module_lidarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_lidarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_medusa.sh b/tools/modules/software/install_medusa.sh new file mode 100644 index 00000000..184ff2a8 --- /dev/null +++ b/tools/modules/software/install_medusa.sh @@ -0,0 +1,80 @@ +declare -A module_options +module_options+=( + ["module_medusa,author"]="@armbian" + ["module_medusa,feature"]="module_medusa" + ["module_medusa,desc"]="Install medusa container" + ["module_medusa,example"]="install remove status help" + ["module_medusa,port"]="8081" + ["module_medusa,status"]="Active" + ["module_medusa,arch"]="x86-64,arm64" +) +# +# Install Module medusa +# +function module_medusa () { + local title="Medusa" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/medusa?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/medusa?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_medusa,example"]}" + + MEDUSA_BASE="${SOFTWARE_FOLDER}/medusa" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$MEDUSA_BASE" ]] || mkdir -p "$MEDUSA_BASE" || { echo "Couldn't create storage directory: $MEDUSA_BASE"; exit 1; } + docker run -d \ + --name=medusa \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 8081:8081 \ + -v "${MEDUSA_BASE}/config:/config" \ + -v "${MEDUSA_BASE}/downloads:/downloads" \ + -v "${MEDUSA_BASE}/downloads/tv:/tv" \ + --restart unless-stopped \ + lscr.io/linuxserver/medusa:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' medusa >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs medusa\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${MEDUSA_BASE}" && "${MEDUSA_BASE}" != "/" ]] && rm -rf "${MEDUSA_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_medusa,feature"]} " + echo -e "Commands: ${module_options["module_medusa,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_medusa,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_portainer.sh b/tools/modules/software/install_portainer.sh index bb283c3e..650ce38e 100644 --- a/tools/modules/software/install_portainer.sh +++ b/tools/modules/software/install_portainer.sh @@ -6,6 +6,7 @@ module_options+=( ["module_portainer,desc"]="Install/uninstall/check status of portainer container" ["module_portainer,example"]="help install uninstall status" ["module_portainer,status"]="Active" + ["module_portainer,port"]="9000" ) # # Install portainer container @@ -37,7 +38,11 @@ module_portainer() { install) check_if_installed docker-ce || install_docker docker volume ls -q | grep -xq 'portainer_data' || docker volume create portainer_data - docker run -d -p '9002:9000' --name=portainer --restart=always \ + docker run -d \ + -p '9000:9000' \ + -p '8000:8000' \ + -p '9443:9443' \ + --name=portainer --restart=always \ -v '/run/docker.sock:/var/run/docker.sock' \ -v '/etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt:ro' \ -v 'portainer_data:/data' 'portainer/portainer-ce' diff --git a/tools/modules/software/install_prowlarr.sh b/tools/modules/software/install_prowlarr.sh new file mode 100644 index 00000000..3d2b72f9 --- /dev/null +++ b/tools/modules/software/install_prowlarr.sh @@ -0,0 +1,77 @@ +module_options+=( + ["module_prowlarr,author"]="@armbian" + ["module_prowlarr,feature"]="module_prowlarr" + ["module_prowlarr,desc"]="Install prowlarr container" + ["module_prowlarr,example"]="install remove status help" + ["module_prowlarr,port"]="9696" + ["module_prowlarr,status"]="Active" + ["module_prowlarr,arch"]="x86-64,arm64" +) +# +# Module prowlarr +# +function module_prowlarr () { + local title="prowlarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/prowlarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/prowlarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_prowlarr,example"]}" + + PROWLARR_BASE="${SOFTWARE_FOLDER}/prowlarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$PROWLARR_BASE" ]] || mkdir -p "$PROWLARR_BASE" || { echo "Couldn't create storage directory: $PROWLARR_BASE"; exit 1; } + docker run -d \ + --name=prowlarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 9696:9696 \ + -v "${PROWLARR_BASE}/config:/config" \ + --restart unless-stopped \ + lscr.io/linuxserver/prowlarr:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' prowlarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs prowlarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${PROWLARR_BASE}" && "${PROWLARR_BASE}" != "/" ]] && rm -rf "${PROWLARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_prowlarr,feature"]} " + echo -e "Commands: ${module_options["module_prowlarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_prowlarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_qbittorrent.sh b/tools/modules/software/install_qbittorrent.sh new file mode 100644 index 00000000..c331660d --- /dev/null +++ b/tools/modules/software/install_qbittorrent.sh @@ -0,0 +1,84 @@ +declare -A module_options +module_options+=( + ["module_qbittorrent,author"]="@armbian" + ["module_qbittorrent,feature"]="module_qbittorrent" + ["module_qbittorrent,desc"]="Install qbittorrent container" + ["module_qbittorrent,example"]="install remove status help" + ["module_qbittorrent,port"]="8090 6881" + ["module_qbittorrent,status"]="Active" + ["module_qbittorrent,arch"]="x86-64,arm64" +) +# +# Module qbittorrent +# +function module_qbittorrent () { + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/qbittorrent?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/qbittorrent?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_qbittorrent,example"]}" + + QBITTORRENT_BASE="${SOFTWARE_FOLDER}/qbittorrent" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$QBITTORRENT_BASE" ]] || mkdir -p "$QBITTORRENT_BASE" || { echo "Couldn't create storage directory: $QBITTORRENT_BASE"; exit 1; } + docker run -d \ + --name=qbittorrent \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -e WEBUI_PORT=8090 \ + -e TORRENTING_PORT=6881 \ + -p 8090:8090 \ + -p 6881:6881 \ + -p 6881:6881/udp \ + -v "${QBITTORRENT_BASE}/config:/config" \ + -v "${QBITTORRENT_BASE}/downloads:/downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/qbittorrent:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' qbittorrent >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs qbittorrent\`)" + exit 1 + fi + done + sleep 3 + TEMP_PASSWORD=$(docker logs qbittorrent 2>&1 | grep password | grep session | cut -d":" -f2 | xargs) + dialog --msgbox "Qbittorrent is listening at http://$LOCALIPADD:${module_options["module_qbittorrent,port"]}\n\nLogin as: admin\n\nTemporally password: ${TEMP_PASSWORD} " 9 70 + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${QBITTORRENT_BASE}" && "${QBITTORRENT_BASE}" != "/" ]] && rm -rf "${QBITTORRENT_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_qbittorrent,feature"]} " + echo -e "Commands: ${module_options["module_qbittorrent,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_qbittorrent,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_radarr.sh b/tools/modules/software/install_radarr.sh new file mode 100644 index 00000000..37ff9c09 --- /dev/null +++ b/tools/modules/software/install_radarr.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_radarr,author"]="@armbian" + ["module_radarr,feature"]="module_radarr" + ["module_radarr,desc"]="Install radarr container" + ["module_radarr,example"]="install remove status help" + ["module_radarr,port"]="7878" + ["module_radarr,status"]="Active" + ["module_radarr,arch"]="x86-64,arm64" +) +# +# Module radarr +# +function module_radarr () { + local title="radarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/radarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/radarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_radarr,example"]}" + + RADARR_BASE="${SOFTWARE_FOLDER}/radarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$RADARR_BASE" ]] || mkdir -p "$RADARR_BASE" || { echo "Couldn't create storage directory: $RADARR_BASE"; exit 1; } + docker run -d \ + --name=radarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 7878:7878 \ + -v "${RADARR_BASE}/config:/config" \ + -v "${RADARR_BASE}/movies:/movies" `#optional` \ + -v "${RADARR_BASE}/client:/downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/radarr:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' radarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs radarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${RADARR_BASE}" && "${RADARR_BASE}" != "/" ]] && rm -rf "${RADARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_radarr,feature"]} " + echo -e "Commands: ${module_options["module_radarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_radarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_readarr.sh b/tools/modules/software/install_readarr.sh new file mode 100644 index 00000000..b81b0bdf --- /dev/null +++ b/tools/modules/software/install_readarr.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_readarr,author"]="@armbian" + ["module_readarr,feature"]="module_readarr" + ["module_readarr,desc"]="Install readarr container" + ["module_readarr,example"]="install remove status help" + ["module_readarr,port"]="8787" + ["module_readarr,status"]="Active" + ["module_readarr,arch"]="x86-64,arm64" +) +# +# Module readarr +# +function module_readarr () { + local title="readarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/readarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/readarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_readarr,example"]}" + + READARR_BASE="${SOFTWARE_FOLDER}/readarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$READARR_BASE" ]] || mkdir -p "$READARR_BASE" || { echo "Couldn't create storage directory: $READARR_BASE"; exit 1; } + docker run -d \ + --name=readarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ=Etc/UTC \ + -p 8787:8787 \ + -v "${READARR_BASE}/config:/config" \ + -v "${READARR_BASE}/books:/books" `#optional` \ + -v "${READARR_BASE}/client:/downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/readarr:develop + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' readarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs readarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${READARR_BASE}" && "${READARR_BASE}" != "/" ]] && rm -rf "${READARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_readarr,feature"]} " + echo -e "Commands: ${module_options["module_readarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_readarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_sabnzbd.sh b/tools/modules/software/install_sabnzbd.sh new file mode 100644 index 00000000..418de54d --- /dev/null +++ b/tools/modules/software/install_sabnzbd.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_sabnzbd,author"]="@armbian" + ["module_sabnzbd,feature"]="module_sabnzbd" + ["module_sabnzbd,desc"]="Install sabnzbd container" + ["module_sabnzbd,example"]="install remove status help" + ["module_sabnzbd,port"]="8080" + ["module_sabnzbd,status"]="Active" + ["module_sabnzbd,arch"]="x86-64,arm64" +) +# +# Module Sabnzbd +# +function module_sabnzbd () { + local title="Sabnzbd" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/sabnzbd?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/sabnzbd?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_sabnzbd,example"]}" + + SABNZBD_BASE="${SOFTWARE_FOLDER}/sabnzbd" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$SABNZBD_BASE" ]] || mkdir -p "$SABNZBD_BASE" || { echo "Couldn't create storage directory: $SABNZBD_BASE"; exit 1; } + docker run -d \ + --name=sabnzbd \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 8080:8080 \ + -v "${SABNZBD_BASE}/config:/config" \ + -v "${SABNZBD_BASE}/downloads:/downloads" `#optional` \ + -v "${SABNZBD_BASE}/incomplete:/incomplete-downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/sabnzbd:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' sabnzbd >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs sabnzbd\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${SABNZBD_BASE}" && "${SABNZBD_BASE}" != "/" ]] && rm -rf "${SABNZBD_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_sabnzbd,feature"]} " + echo -e "Commands: ${module_options["module_sabnzbd,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_sabnzbd,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_sonarr.sh b/tools/modules/software/install_sonarr.sh new file mode 100644 index 00000000..5cda6f22 --- /dev/null +++ b/tools/modules/software/install_sonarr.sh @@ -0,0 +1,79 @@ +module_options+=( + ["module_sonarr,author"]="@armbian" + ["module_sonarr,feature"]="module_sonarr" + ["module_sonarr,desc"]="Install sonarr container" + ["module_sonarr,example"]="install remove status help" + ["module_sonarr,port"]="8989" + ["module_sonarr,status"]="Active" + ["module_sonarr,arch"]="x86-64,arm64" +) +# +# Mmodule_sonarr +# +function module_sonarr () { + local title="sonarr" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/sonarr?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/sonarr?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_sonarr,example"]}" + + SONARR_BASE="${SOFTWARE_FOLDER}/sonarr" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$SONARR_BASE" ]] || mkdir -p "$SONARR_BASE" || { echo "Couldn't create storage directory: $SONARR_BASE"; exit 1; } + docker run -d \ + --name=sonarr \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -p 8989:8989 \ + -v "${SONARR_BASE}/config:/config" \ + -v "${SONARR_BASE}/tvseries:/tv" `#optional` \ + -v "${SONARR_BASE}/client:/downloads" `#optional` \ + --restart unless-stopped \ + lscr.io/linuxserver/sonarr:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' sonarr >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs sonarr\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${SONARR_BASE}" && "${SONARR_BASE}" != "/" ]] && rm -rf "${SONARR_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_sonarr,feature"]} " + echo -e "Commands: ${module_options["module_sonarr,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_sonarr,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/software/install_transmission.sh b/tools/modules/software/install_transmission.sh new file mode 100644 index 00000000..cdd24cc0 --- /dev/null +++ b/tools/modules/software/install_transmission.sh @@ -0,0 +1,87 @@ +module_options+=( + ["module_transmission,author"]="@armbian" + ["module_transmission,feature"]="module_transmission" + ["module_transmission,desc"]="Install transmission container" + ["module_transmission,example"]="install remove status help" + ["module_transmission,port"]="9091" + ["module_transmission,status"]="Active" + ["module_transmission,arch"]="x86-64,arm64" +) +# +# Module transmission +# +function module_transmission () { + local title="transmission" + local condition=$(which "$title" 2>/dev/null) + + if check_if_installed docker-ce; then + local container=$(docker container ls -a | mawk '/transmission?( |$)/{print $1}') + local image=$(docker image ls -a | mawk '/transmission?( |$)/{print $3}') + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_transmission,example"]}" + + TRANSMISSION_BASE="${SOFTWARE_FOLDER}/transmission" + + case "$1" in + "${commands[0]}") + check_if_installed docker-ce || install_docker + [[ -d "$TRANSMISSION_BASE" ]] || mkdir -p "$TRANSMISSION_BASE" || { echo "Couldn't create storage directory: $TRANSMISSION_BASE"; exit 1; } + docker run -d \ + --name=transmission \ + -e PUID=1000 \ + -e PGID=1000 \ + -e TZ="$(cat /etc/timezone)" \ + -e TRANSMISSION_WEB_HOME= `#optional` \ + -e USER= `#optional` \ + -e PASS= `#optional` \ + -e WHITELIST= `#optional` \ + -e PEERPORT= `#optional` \ + -e HOST_WHITELIST= `#optional` \ + -p 9091:9091 \ + -p 51413:51413 \ + -p 51413:51413/udp \ + -v "${TRANSMISSION_BASE}/config:/config" \ + -v "${TRANSMISSION_BASE}/downloads:/downloads" \ + -v "${TRANSMISSION_BASE}/watch:/watch" \ + --restart unless-stopped \ + lscr.io/linuxserver/transmission:latest + for i in $(seq 1 20); do + if docker inspect -f '{{ index .Config.Labels "build_version" }}' transmission >/dev/null 2>&1 ; then + break + else + sleep 3 + fi + if [ $i -eq 20 ] ; then + echo -e "\nTimed out waiting for ${title} to start, consult your container logs for more info (\`docker logs transmission\`)" + exit 1 + fi + done + ;; + "${commands[1]}") + [[ "${container}" ]] && docker container rm -f "$container" >/dev/null + [[ "${image}" ]] && docker image rm "$image" >/dev/null + [[ -n "${TRANSMISSION_BASE}" && "${TRANSMISSION_BASE}" != "/" ]] && rm -rf "${TRANSMISSION_BASE}" + ;; + "${commands[2]}") + if [[ "${container}" && "${image}" ]]; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_transmission,feature"]} " + echo -e "Commands: ${module_options["module_transmission,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_transmission,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/system/Headers_install.sh b/tools/modules/system/Headers_install.sh deleted file mode 100644 index 17832922..00000000 --- a/tools/modules/system/Headers_install.sh +++ /dev/null @@ -1,23 +0,0 @@ -module_options+=( - ["Headers_install,author"]="@Tearran" - ["Headers_install,ref_link"]="" - ["Headers_install,feature"]="Headers_install" - ["Headers_install,desc"]="Install kernel headers" - ["Headers_install,example"]="is_package_manager_running" - ["Headers_install,status"]="Pending Review" - ["Headers_install,doc_link"]="" -) -# -# @description Install kernel headers -# -function Headers_install() { - if ! is_package_manager_running; then - if [[ -f /etc/armbian-release ]]; then - INSTALL_PKG="linux-headers-${BRANCH}-${LINUXFAMILY}" - else - INSTALL_PKG="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')" - fi - debconf-apt-progress -- apt-get -y install ${INSTALL_PKG} - fi -} - diff --git a/tools/modules/system/Headers_remove.sh b/tools/modules/system/Headers_remove.sh deleted file mode 100644 index 72dc2b3f..00000000 --- a/tools/modules/system/Headers_remove.sh +++ /dev/null @@ -1,27 +0,0 @@ -module_options+=( - ["Headers_remove,author"]="@Tearran" - ["Headers_remove,ref_link"]="https://github.com/armbian/config/blob/master/debian-config-jobs#L160" - ["Headers_remove,feature"]="Headers_remove" - ["Headers_remove,desc"]="Remove Linux headers" - ["Headers_remove,example"]="Headers_remove" - ["Headers_remove,status"]="Pending Review" - ["Headers_remove,doc_link"]="https://github.com/armbian/config/wiki#System" -) -# -# @description Remove Linux headers -# -function Headers_remove() { - if ! is_package_manager_running; then - REMOVE_PKG="linux-headers-*" - if [[ -n $(dpkg -l | grep linux-headers) ]]; then - debconf-apt-progress -- apt-get -y purge ${REMOVE_PKG} - rm -rf /usr/src/linux-headers* - else - debconf-apt-progress -- apt-get -y install ${INSTALL_PKG} - fi - # cleanup - apt clean - debconf-apt-progress -- apt -y autoremove - fi -} - diff --git a/tools/modules/system/are_headers_installed.sh b/tools/modules/system/are_headers_installed.sh deleted file mode 100644 index e6059eb2..00000000 --- a/tools/modules/system/are_headers_installed.sh +++ /dev/null @@ -1,23 +0,0 @@ -module_options+=( - ["are_headers_installed,author"]="@viraniac" - ["are_headers_installed,ref_link"]="" - ["are_headers_installed,feature"]="are_headers_installed" - ["are_headers_installed,desc"]="Check if kernel headers are installed" - ["are_headers_installed,example"]="are_headers_installed" - ["are_headers_installed,status"]="Pending Review" - ["are_headers_installed,doc_link"]="" -) -# -# @description Install kernel headers -# -function are_headers_installed() { - if [[ -f /etc/armbian-release ]]; then - PKG_NAME="linux-headers-${BRANCH}-${LINUXFAMILY}" - else - PKG_NAME="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')" - fi - - check_if_installed ${PKG_NAME} - return $? -} - diff --git a/tools/modules/system/armbian_fw_manipulate.sh b/tools/modules/system/armbian_fw_manipulate.sh index 3cd3f841..162a0aba 100644 --- a/tools/modules/system/armbian_fw_manipulate.sh +++ b/tools/modules/system/armbian_fw_manipulate.sh @@ -31,8 +31,8 @@ armbian_fw_manipulate() { ) # reinstall headers only if they were previously installed - if are_headers_installed; then - local armbian_packages+="linux-headers-${branch}-${LINUXFAMILY}" + if dpkg -l | grep -E "linux-headers" >/dev/null; then + local armbian_packages+=("linux-headers-${branch}-${LINUXFAMILY}") fi local packages="" @@ -72,5 +72,13 @@ armbian_fw_manipulate() { *) return ;; esac done + + # update branch information + BRANCH=$(dpkg -l | grep -E "linux-image" | grep -E "current|legacy|edge" | awk '{print $2}' | cut -d"-" -f3 | head -1) + if grep -q BRANCH /etc/armbian-release; then + [[ -n ${BRANCH} ]] && sed -i "s/BRANCH=.*/BRANCH=$BRANCH/g" /etc/armbian-release + else + [[ -n ${BRANCH} ]] && echo "BRANCH=$BRANCH" >> /etc/armbian-release + fi } diff --git a/tools/modules/system/get_headers_install.sh b/tools/modules/system/get_headers_install.sh deleted file mode 100644 index 5a118d12..00000000 --- a/tools/modules/system/get_headers_install.sh +++ /dev/null @@ -1,24 +0,0 @@ - -menu_options+=( - ["get_headers_kernel,author"]="@igorpecovnik" - ["get_headers_kernel,ref_link"]="" - ["get_headers_kernel,feature"]="get_headers_install" - ["get_headers_kernel,desc"]="Migrated procedures from Armbian config." - ["get_headers_kernel,example"]="get_headers_install" - ["get_headers_kernel,status"]="Active" - ["get_headers_kernel,doc_link"]="" -) -# -# install kernel headers -# -function get_headers_install() { - - if [[ -f /etc/armbian-release ]]; then - INSTALL_PKG="linux-headers-${BRANCH}-${LINUXFAMILY}" - else - INSTALL_PKG="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')" - fi - - debconf-apt-progress -- apt-get -y install ${INSTALL_PKG} || exit 1 - -} diff --git a/tools/modules/system/install_headers.sh b/tools/modules/system/install_headers.sh new file mode 100644 index 00000000..872c4806 --- /dev/null +++ b/tools/modules/system/install_headers.sh @@ -0,0 +1,64 @@ +module_options+=( + ["module_headers,author"]="@armbian" + ["module_headers,feature"]="module_headers" + ["module_headers,desc"]="Install headers container" + ["module_headers,example"]="install remove status help" + ["module_headers,port"]="" + ["module_headers,status"]="Active" + ["module_headers,arch"]="" +) +# +# Mmodule_headers +# +function module_headers () { + local title="headers" + local condition=$(which "$title" 2>/dev/null) + + if [[ -f /etc/armbian-release ]]; then + source /etc/armbian-release + # branch information is stored in armbian-release at boot time. When we change kernel branches, we need to re-read this and add it + if [[ -z "${BRANCH}" ]]; then + BRANCH=$(dpkg -l | grep -E "linux-image" | grep -E "current|vendor|legacy|edge" | awk '{print $2}' | cut -d"-" -f3 | head -1) + if grep -q BRANCH /etc/armbian-release; then + [[ -n ${BRANCH} ]] && sed -i "s/BRANCH=.*/BRANCH=$BRANCH/g" /etc/armbian-release + else + [[ -n ${BRANCH} ]] && echo "BRANCH=$BRANCH" >> /etc/armbian-release + fi + fi + local install_pkg="linux-headers-${BRANCH}-${LINUXFAMILY}" + else + local install_pkg="linux-headers-$(uname -r | sed 's/'-$(dpkg --print-architecture)'//')" + fi + + local commands + IFS=' ' read -r -a commands <<< "${module_options["module_headers,example"]}" + + case "$1" in + "${commands[0]}") + apt_install_wrapper apt-get -y install ${install_pkg} build-essential git || exit 1 + ;; + "${commands[1]}") + apt_install_wrapper apt-get -y autopurge ${install_pkg} build-essential || exit 1 + rm -rf /usr/src/linux-headers* + ;; + "${commands[2]}") + if check_if_installed ${install_pkg}; then + return 0 + else + return 1 + fi + ;; + "${commands[3]}") + echo -e "\nUsage: ${module_options["module_headers,feature"]} " + echo -e "Commands: ${module_options["module_headers,example"]}" + echo "Available commands:" + echo -e "\tinstall\t- Install $title." + echo -e "\tstatus\t- Installation status $title." + echo -e "\tremove\t- Remove $title." + echo + ;; + *) + ${module_options["module_headers,feature"]} ${commands[3]} + ;; + esac +} diff --git a/tools/modules/system/set_header_remove.sh b/tools/modules/system/set_header_remove.sh deleted file mode 100644 index 0290dc9c..00000000 --- a/tools/modules/system/set_header_remove.sh +++ /dev/null @@ -1,30 +0,0 @@ - - -module_options+=( - ["set_header_remove,author"]="@igorpecovnik" - ["set_header_remove,ref_link"]="" - ["set_header_remove,feature"]="set_header_remove" - ["set_header_remove,desc"]="Migrated procedures from Armbian config." - ["set_header_remove,example"]="set_header_remove" - ["set_header_remove,doc_link"]="" - ["set_header_remove,status"]="Active" - ["set_header_remove,doc_ink"]="" -) -# -# remove kernel headers -# -function set_header_remove() { - - REMOVE_PKG="linux-headers-*" - if [[ -n $(dpkg -l | grep linux-headers) ]]; then - debconf-apt-progress -- apt-get -y purge ${REMOVE_PKG} - rm -rf /usr/src/linux-headers* - else - debconf-apt-progress -- apt-get -y install ${INSTALL_PKG} - fi - # cleanup - apt clean - debconf-apt-progress -- apt -y autoremove - -} - diff --git a/tools/modules/system/switch_kernels.sh b/tools/modules/system/switch_kernels.sh index 56a75985..d183dc84 100644 --- a/tools/modules/system/switch_kernels.sh +++ b/tools/modules/system/switch_kernels.sh @@ -13,6 +13,8 @@ function switch_kernels() { # we only allow switching kerneles that are in the test pool [[ -z "${KERNEL_TEST_TARGET}" ]] && KERNEL_TEST_TARGET="legacy,current,edge" + dialog --title "Warning!" --yesno "\nInclude untested kernels on the list?" 7 60 + [[ $? -eq 0 ]] && KERNEL_TEST_TARGET="legacy,vendor,current,edge" local kernel_test_target=$(for x in ${KERNEL_TEST_TARGET//,/ }; do echo "linux-image-$x-${LINUXFAMILY}"; done;) local installed_kernel_version=$(dpkg -l | grep '^ii' | grep linux-image | awk '{print $2"="$3}') # just in case current is not installed