-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add software items to install/remove Plex Media Server, Emby Server a…
…nd Docker (#100) * Modify function 'check_if_installed' to catch previously installed but not currently installed. * Add software install/remove Plex, Emby and Docker Plex Media Server, Emby Server, Docker Minimal, Docker Engine and Docker delete all images, containers, and volumes (if docker has been removed). * Revert function removal * Styling and various minor tweaks * We don't need executable bit * Apply shell formating shfmt -w lib/armbian-configng/config.ng.software.sh --------- Co-authored-by: schwar3kat <[email protected]>
- Loading branch information
1 parent
c93bfdd
commit 36ff716
Showing
3 changed files
with
225 additions
and
22 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 |
---|---|---|
@@ -1,22 +1,114 @@ | ||
module_options+=( | ||
["see_monitoring,author"]="Joey Turner" | ||
["see_monitoring,ref_link"]="" | ||
["see_monitoring,feature"]="see_monitoring" | ||
["see_monitoring,desc"]="Menu for armbianmonitor features" | ||
["see_monitoring,example"]="see_monitoring" | ||
["see_monitoring,status"]="review" | ||
["see_monitoring,doc_link"]="" | ||
["see_monitoring,author"]="Joey Turner" | ||
["see_monitoring,ref_link"]="" | ||
["see_monitoring,feature"]="see_monitoring" | ||
["see_monitoring,desc"]="Menu for armbianmonitor features" | ||
["see_monitoring,example"]="see_monitoring" | ||
["see_monitoring,status"]="review" | ||
["see_monitoring,doc_link"]="" | ||
) | ||
# | ||
# @decrition generate a menu for armbianmonitor | ||
# | ||
function see_monitoring() { | ||
if [ -f /usr/bin/htop ]; then | ||
choice=$(armbianmonitor -h | grep -Ev '^\s*-c\s|^\s*-M\s' | show_menu) | ||
if [ -f /usr/bin/htop ]; then | ||
choice=$(armbianmonitor -h | grep -Ev '^\s*-c\s|^\s*-M\s' | show_menu) | ||
|
||
armbianmonitor -$choice | ||
|
||
else | ||
echo "htop is not installed" | ||
fi | ||
armbianmonitor -$choice | ||
|
||
else | ||
echo "htop is not installed" | ||
fi | ||
} | ||
|
||
module_options+=( | ||
["update_skel,author"]="Kat Schwarz" | ||
["update_skel,ref_link"]="" | ||
["update_skel,feature"]="install_plexmediaserver" | ||
["update_skel,desc"]="Install plexmediaserver from repo using apt" | ||
["update_skel,example"]="install_plexmediaserver" | ||
["update_skel,status"]="Active" | ||
) | ||
# | ||
# Install plexmediaserver using apt | ||
# | ||
install_plexmediaserver() { | ||
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 | ||
apt_install_wrapper apt-get update | ||
apt_install_wrapper apt-get -y install plexmediaserver | ||
whiptail --msgbox "To test that Plex Media Server has installed successfully\nIn a web browser go to http://localhost:32400/web or \nhttp://127.0.0.1:32400/web on this computer." 9 70 | ||
} | ||
|
||
module_options+=( | ||
["update_skel,author"]="Kat Schwarz" | ||
["update_skel,ref_link"]="" | ||
["update_skel,feature"]="install_embyserver" | ||
["update_skel,desc"]="Download a embyserver deb file from a URL and install using apt" | ||
["update_skel,example"]="install_embyserver" | ||
["update_skel,status"]="Active" | ||
) | ||
# | ||
# Download a deb file from a URL and install using wget and apt with dialog progress bars | ||
# | ||
install_embyserver() { | ||
URL=$(curl -s https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | | ||
grep "/emby-server-deb.*$(dpkg --print-architecture).deb" | cut -d : -f 2,3 | tr -d '"') | ||
cd ~/ | ||
wget -O "emby-server.deb" $URL 2>&1 | stdbuf -oL awk '/[.] +[0-9][0-9]?[0-9]?%/ { print substr($0,63,3) }' | | ||
whiptail --gauge "Please wait\nDownloading ${URL##*/}" 8 70 0 | ||
apt_install_wrapper apt-get -y install ~/emby-server.deb | ||
unlink emby-server.deb | ||
whiptail --msgbox "To test that Emby Server has installed successfully\nIn a web browser go to http://localhost:8096 or \nhttp://127.0.0.1:8096 on this computer." 9 70 | ||
} | ||
|
||
module_options+=( | ||
["update_skel,author"]="Kat Schwarz" | ||
["update_skel,ref_link"]="" | ||
["update_skel,feature"]="install_docker" | ||
["update_skel,desc"]="Install docker from a repo using apt" | ||
["update_skel,example"]="install_docker engine" | ||
["update_skel,status"]="Active" | ||
) | ||
# | ||
# Install Docker from repo using apt | ||
# Setup sources list and GPG key then install the app. If you want a full desktop then $1=desktop | ||
# | ||
install_docker() { | ||
# Check if repo for distribution exists. | ||
distro=$(echo $DISTRO | tr '[:upper:]' '[:lower:]') | ||
URL="https://download.docker.com/linux/$distro/dists/$(. /etc/os-release && echo "$VERSION_CODENAME")" | ||
if wget --spider "${URL}" 2> /dev/null; then | ||
# Add Docker's official GPG key: | ||
apt_install_wrapper apt-get update | ||
apt_install_wrapper apt-get -y install ca-certificates curl | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
sudo curl -fsSL https://download.docker.com/linux/$distro/gpg -o /etc/apt/keyrings/docker.asc | ||
sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
|
||
# Add the repository to Apt sources: | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/$distro \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
apt_install_wrapper apt-get update | ||
|
||
# Install docker | ||
if [ "$1" = "engine" ]; then | ||
apt_install_wrapper apt-get -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | ||
else | ||
apt_install_wrapper apt-get -y install docker-ce docker-ce-cli containerd.io | ||
fi | ||
systemctl enable docker.service > /dev/null 2>&1 | ||
systemctl enable containerd.service > /dev/null 2>&1 | ||
whiptail --msgbox "To test that Docker has installed successfully\nrun the following command: docker run hello-world" 9 70 | ||
else | ||
whiptail --msgbox "ERROR ! $distro $(. /etc/os-release && echo "$VERSION_CODENAME") distribution not found in repository!" 7 70 | ||
fi | ||
} |