-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a collection of applications for downloading
- Loading branch information
1 parent
f7acc2c
commit 679399f
Showing
13 changed files
with
1,220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
Oops, something went wrong.