Skip to content

Commit

Permalink
Bazarr: adjust module options to match changes
Browse files Browse the repository at this point in the history
- attach to custom docker bridge
- add purge option
  • Loading branch information
igorpecovnik committed Dec 22, 2024
1 parent 2d437c2 commit 0ea186a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
21 changes: 17 additions & 4 deletions tools/json/config.software.json
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,9 @@
"condition": "module_radarr status"
},
{
"id": "DOW019",
"description": "Install Bazarr",
"id": "DOW100",
"description": "Bazarr Install",
"about": "This operation will install Bazarr container",
"command": [
"module_bazarr install"
],
Expand All @@ -559,15 +560,27 @@
"condition": "! module_bazarr status"
},
{
"id": "DOW020",
"description": "Remove Bazarr",
"id": "DOW101",
"description": "Bazarr Remove",
"about": "This operation will remove Bazarr container",
"command": [
"module_bazarr remove"
],
"status": "Stable",
"author": "@armbian",
"condition": "module_bazarr status"
},
{
"id": "DOW102",
"description": "Bazarr Purge data folder",
"about": "This operation will remove Bazarr data folder",
"command": [
"module_bazarr purge"
],
"status": "Stable",
"author": "@armbian",
"condition": "! module_bazarr status && [[ -d \"${SOFTWARE_FOLDER}/bazarr\" ]]"
},
{
"id": "DOW021",
"description": "Install Lidarr",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
module_options+=(
["module_bazarr,author"]="@igorpecovnik"
["module_bazarr,author"]=""
["module_bazarr,maintainer"]="@igorpecovnik"
["module_bazarr,feature"]="module_bazarr"
["module_bazarr,example"]="install remove purge status help"
["module_bazarr,desc"]="Install bazarr container"
["module_bazarr,example"]="install remove status help"
["module_bazarr,port"]="6767"
["module_bazarr,status"]="Active"
["module_bazarr,doc_link"]="https://wiki.bazarr.media/"
["module_bazarr,group"]="Downloaders"
["module_bazarr,port"]="6767"
["module_bazarr,arch"]="x86-64,arm64"
)
#
Expand All @@ -30,6 +33,7 @@ function module_bazarr () {
[[ -d "$BAZARR_BASE" ]] || mkdir -p "$BAZARR_BASE" || { echo "Couldn't create storage directory: $BAZARR_BASE"; exit 1; }
docker run -d \
--name=bazarr \
--net=lsio \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Etc/UTC \
Expand All @@ -54,26 +58,29 @@ function module_bazarr () {
"${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]}")
[[ -n "${BAZARR_BASE}" && "${BAZARR_BASE}" != "/" ]] && rm -rf "${BAZARR_BASE}"
;;
"${commands[3]}")
if [[ "${container}" && "${image}" ]]; then
return 0
else
return 1
fi
;;
"${commands[3]}")
"${commands[4]}")
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 -e "\tremove\t- Purge $title."
echo
;;
*)
${module_options["module_bazarr,feature"]} ${commands[3]}
${module_options["module_bazarr,feature"]} ${commands[4]}
;;
esac
}

0 comments on commit 0ea186a

Please sign in to comment.