-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Portainer and Webmin: adjust module options to match changes
- Loading branch information
1 parent
11f3c8c
commit 5bb9df1
Showing
20 changed files
with
304 additions
and
206 deletions.
There are no files selected for viewing
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
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
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,64 @@ | ||
module_options+=( | ||
["module_plexmediaserver,author"]="@schwar3kat" | ||
["module_plexmediaserver,maintainer"]="@igorpecovnik" | ||
["module_plexmediaserver,feature"]="Install plexmediaserver" | ||
["module_plexmediaserver,example"]="install remove status" | ||
["module_plexmediaserver,desc"]="Install plexmediaserver from repo using apt" | ||
["module_plexmediaserver,status"]="Active" | ||
["module_plexmediaserver,doc_link"]="https://www.plex.tv/" | ||
["module_plexmediaserver,group"]="Media" | ||
["module_plexmediaserver,port"]="32400" | ||
["module_plexmediaserver,arch"]="x86-64 arm64" | ||
|
||
) | ||
# | ||
# Install plexmediaserver using apt | ||
# | ||
module_plexmediaserver() { | ||
local title="plexmediaserver" | ||
local condition=$(which "$title" 2>/dev/null) | ||
|
||
local commands | ||
IFS=' ' read -r -a commands <<< "${module_options["module_plexmediaserver,example"]}" | ||
|
||
case "$1" in | ||
"${commands[0]}") | ||
if [ ! -f /etc/apt/sources.list.d/plexmediaserver.list ]; then | ||
echo "deb [arch=$(dpkg --print-architecture) \ | ||
signed-by=/usr/share/keyrings/plexmediaserver.gpg] https://downloads.plex.tv/repo/deb public main" \ | ||
| sudo tee /etc/apt/sources.list.d/plexmediaserver.list > /dev/null 2>&1 | ||
else | ||
sed -i "/downloads.plex.tv/s/^#//g" /etc/apt/sources.list.d/plexmediaserver.list > /dev/null 2>&1 | ||
fi | ||
# Note: for compatibility with existing source file in some builds format must be gpg not asc | ||
# and location must be /usr/share/keyrings | ||
wget -qO- https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor \ | ||
| sudo tee /usr/share/keyrings/plexmediaserver.gpg > /dev/null 2>&1 | ||
pkg_update | ||
pkg_install plexmediaserver | ||
;; | ||
"${commands[1]}") | ||
sed -i '/plexmediaserver.gpg/s/^/#/g' /etc/apt/sources.list.d/plexmediaserver.list | ||
pkg_remove plexmediaserver | ||
;; | ||
"${commands[2]}") | ||
if pkg_installed plexmediaserver; then | ||
return 0 | ||
else | ||
return 1 | ||
fi | ||
;; | ||
"${commands[3]}") | ||
echo -e "\nUsage: ${module_options["module_portainer,feature"]} <command>" | ||
echo -e "Commands: ${module_options["module_portainer,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_plexmediaserver,feature"]} ${commands[3]} | ||
;; | ||
esac | ||
} |
Oops, something went wrong.