Skip to content

Commit

Permalink
Add a collection of applications for downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
igorpecovnik committed Nov 26, 2024
1 parent f7acc2c commit 679399f
Show file tree
Hide file tree
Showing 13 changed files with 1,220 additions and 0 deletions.
226 changes: 226 additions & 0 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,232 @@
}
]
},
{
"id": "Downloaders",
"description": "Downloaders",
"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",
Expand Down
14 changes: 14 additions & 0 deletions tools/modules/runtime/config.runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,17 @@ plex_media_port="$(lsof -i -P -n | grep TCP | grep LISTEN | grep 'plex' | awk -F
update_sub_submenu_data "Software" "Media" "SW22" "https://localhost:$plex_media_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"]}"

88 changes: 88 additions & 0 deletions tools/modules/software/install_bazarr.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
declare -A module_options
module_options+=(
["module_bazarr,author"]="@armbian"
["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"
)
#
# Install Pi-Hole DNS blocking
#
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=/opt/bazarr
BAZARR_BASE="${BAZARR_BASE:-$(pwd)}"
[[ -d "$BAZARR_BASE" ]] || mkdir -p "$BAZARR_BASE" || { echo "Couldn't create storage directory: $BAZARR_BASE"; exit 1; }

case "$1" in
"${commands[0]}")
check_if_installed docker-ce || install_docker
docker run -d \
--name=bazarr \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
-p 6767:6767 \
-v "${BAZARR_BASE}/bazarr/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"]} <command>"
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
}


function check_if_installed(){
return 0
}

module_bazarr "$1"

Loading

0 comments on commit 679399f

Please sign in to comment.