Skip to content

Commit

Permalink
updated DockerMods to return exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
revenz committed May 18, 2024
1 parent 4e5f725 commit 56a7bc9
Show file tree
Hide file tree
Showing 16 changed files with 449 additions and 191 deletions.
44 changes: 32 additions & 12 deletions DockerMods/7-Zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,43 @@
# Name: 7-Zip
# Description: 7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as "archives".
# Author: John Andrews
# Revision: 1
# Revision: 2
# Icon: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzQiIHdpZHRoPSI0NCI+Cgk8cmVjdCB3aWR0aD0iNDIiIGhlaWdodD0iMzIiIGZpbGw9IiNmZmYiLz4KCTxwYXRoIGQ9Im0yOCAxM3YzaDUuM2wtNS4zIDcuN3YzLjNoOXYtM2gtNS4zbDUuMy03Ljd2LTMuM3ptLTE3LTN2M2g3LjVsLTQuNSA0LjV2Ni41aDR2LTYuNWw0LTR2LTMuNW0tMTUtM2gxOHYyMGgtMTh6bS03LTd2MzRoNDR2LTM0em0zIDNoMzh2MjhoLTM4Ii8+Cjwvc3ZnPgo=
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if 7zip is installed
if ! command -v 7z &>/dev/null; then
echo "7zip is not installed. Installing..."

# Update package lists
apt update

# Install p7zip-full
apt install -y p7zip-full

echo "Installation complete."
else
if command -v 7z &>/dev/null; then
echo "7zip is already installed."
exit 0
fi

echo "7zip is not installed. Installing..."

# Update package lists
if ! apt update; then
handle_error
fi

# Install p7zip-full
if ! apt install -y p7zip-full; then
handle_error
fi

echo "Installation complete."

# Check if 7zip is now installed
if command -v 7z &>/dev/null; then
echo "7zip successfully installed."
exit 0
else
echo "Failed to install 7zip."
exit 1
fi
36 changes: 27 additions & 9 deletions DockerMods/Docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,38 @@
# Name: Docker
# Description: Installs Docker inside Docker. This allows you to launch sibling Docker containers.
# Author: John Andrews
# Revision: 1
# Revision: 2
# Icon: fab fa-docker:#0076BF
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if Docker is installed
if ! command -v docker &>/dev/null; then
echo "ImageMagick is not installed. Installing..."
if command -v docker &>/dev/null; then
echo "Docker is already installed."
exit 0
fi

echo "Docker is not installed. Installing..."

# Install Docker
curl -fsSL https://get.docker.com | sh;

echo "Installation complete."
# Install Docker
if ! curl -fsSL https://get.docker.com | sh; then
handle_error
fi

echo "Installation complete."

# Verify installation
if command -v docker &>/dev/null; then
echo "Docker successfully installed."
exit 0
else
echo "Docker is already installed."
fi
echo "Failed to install Docker."
exit 1
fi
60 changes: 35 additions & 25 deletions DockerMods/FFmpeg6.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,58 @@
# Name: FFmpeg6
# Description: FFmpeg is a free and open-source software project consisting of a suite of libraries and programs for handling video, audio, and other multimedia files and streams. At its core is the command-line ffmpeg tool itself, designed for processing of video and audio files.
# Author: John Andrews
# Revision: 1
# Revision: 2
# Default: true
# Icon: data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyNi4wLjEsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDIwMDAgMjAwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6bm9uZTtzdHJva2U6IzM3OEU0MztzdHJva2Utd2lkdGg6MzAwO3N0cm9rZS1saW5lY2FwOnJvdW5kO3N0cm9rZS1saW5lam9pbjpyb3VuZDtzdHJva2UtbWl0ZXJsaW1pdDo4O30NCjwvc3R5bGU+DQo8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSg1LDUpIj4NCgk8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTY2LjcsMTY2LjdoNTUyLjJMMTY2LjcsNzE4Ljl2NTUyLjJMMTI3MS4xLDE2Ni43aDU1Mi4yTDE2Ni43LDE4MjMuM2g1NTIuMkwxODIzLjMsNzE4Ljl2NTUyLjJsLTU1Mi4yLDU1Mi4yDQoJCWg1NTIuMiIvPg0KPC9nPg0KPC9zdmc+DQo=
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if FFmpeg is installed
if command -v ffmpeg &>/dev/null; then
echo "FFmpeg is already installed."
exit
exit 0
fi

architecture=$(uname -m)

echo "Architecture: $architecture"

if [ "$architecture" == "x86_64" ]; then

echo "The architecture is AMD (x86_64)."
if [ "$architecture" != "x86_64" ] && [ "$architecture" != "armv7l" ] && [ "$architecture" != "aarch64" ] && [[ ! "$architecture" =~ [Aa][Rr][Mm] ]]; then
echo "The architecture is not recognized as AMD or ARM: $architecture."
exit 1
fi

apt-get update
wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list
apt-get update
apt-get install --no-install-recommends --no-install-suggests -y jellyfin-ffmpeg6
ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe
echo "The architecture is recognized."

elif [ "$architecture" == "armv7l" ] || [ "$architecture" == "aarch64" ] || [[ "$architecture" =~ [Aa][Rr][Mm] ]]; then
# Add Jellyfin GPG key with a timeout of 15 seconds
if ! wget -q --timeout=15 -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -; then
handle_error
fi

echo "The architecture is ARM."
# Add Jellyfin repository
os_id=$(awk -F'=' '/^ID=/{ print $NF }' /etc/os-release)
os_codename=$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)
echo "deb [arch=$(dpkg --print-architecture)] https://repo.jellyfin.org/$os_id $os_codename main" | tee /etc/apt/sources.list.d/jellyfin.list

apt-get update
wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.key | apt-key add -
echo "deb [arch=$( dpkg --print-architecture )] https://repo.jellyfin.org/$( awk -F'=' '/^ID=/{ print $NF }' /etc/os-release ) $( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release ) main" | tee /etc/apt/sources.list.d/jellyfin.list
apt-get update
apt-get install --no-install-recommends --no-install-suggests -y jellyfin-ffmpeg6
ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe
# Update package lists again
if ! apt-get update; then
handle_error
fi

else
# Install Jellyfin FFmpeg
if ! apt-get install --no-install-recommends --no-install-suggests -y jellyfin-ffmpeg6; then
handle_error
fi

echo "The architecture is not recognized as AMD or ARM: $architecture."
# Create symbolic links
ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
ln -s /usr/lib/jellyfin-ffmpeg/ffprobe /usr/local/bin/ffprobe

fi
echo "FFmpeg installation and setup complete."
exit 0
38 changes: 27 additions & 11 deletions DockerMods/Git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,38 @@
# Name: Git
# Description: Git simplifies the process of downloading and managing various resources, like software packages or configurations, from remote repositories, making it an essential tool for users seeking efficient access to files and projects.
# Author: John Andrews
# Revision: 1
# Revision: 2
# Icon: fab fa-git-alt:#FF4500
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if Git is installed
if ! command -v git &>/dev/null; then
echo "Git is not installed. Installing..."
# Update package lists
apt update

# Install Git
apt install -y git

echo "Installation complete."
else
if command -v git &>/dev/null; then
echo "Git is already installed."
exit 0
fi

echo "Git is not installed. Installing..."

# Update package lists and install Git
if ! apt update || ! apt install -y git; then
handle_error
fi

echo "Installation complete."

# Verify installation
if command -v git &>/dev/null; then
echo "Git successfully installed."
exit 0
fi

echo "Failed to install Git."
exit 1
40 changes: 28 additions & 12 deletions DockerMods/ImageMagick.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,38 @@
# Name: ImageMagick
# Description: ImageMagick, invoked from the command line as magick, is a free and open-source cross-platform software suite for displaying, creating, converting, modifying, and editing raster images.
# Author: John Andrews
# Revision: 1
# Revision: 2
# Icon: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4IiB2aWV3Qm94PSIwIDAgNDggNDgiIHdpZHRoPSI0OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGxpbmVhckdyYWRpZW50IGlkPSJhIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9Ii05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4LjY5MSAyLjA0MyAyLjA5OC41OTQtMS43NzMgMS4yNjIuMDc4IDIuMTQ1LTEuNzczLTEuMjYyLTIuMDkuNzMuNjcyLTIuMDItMS4zNDgtMS42OTUgMi4yMDMtLjAybS01Ljg0IDQuMjI3LjA3NCAxLjQ4IDEuMzI0Ljc5My0xLjQzLjUxNi0uMzU5IDEuNDY1LS45NzMtMS4xNDEtMS41MjMuMDk4LjgxNi0xLjIzNC0uNTgyLTEuMzg3IDEuNDc3LjM4M203LjA4Mi0uNjY0IDEuNDE4IDEuODk4IDIuMzk1LS4wOTQtMS4zOTEgMS45MjIuODE2IDIuMTg4LTIuMjk3LS43MTEtMS44ODcgMS40NTctLjAxNi0yLjM1OS0xLjk4OC0xLjI5NyAyLjI3Ny0uNzQ2bS42NzItMi4yNTgiIGZpbGw9InVybCgjYikiLz48L2c+PC9zdmc+
# ----------------------------------------------------------------------------------------------------

#!/bin/bash

# Function to handle errors
function handle_error {
echo "An error occurred. Exiting..."
exit 1
}

# Check if ImageMagick is installed
if ! command -v magick &>/dev/null; then
echo "ImageMagick is not installed. Installing..."
# Update package lists
apt update

# Install ImageMagick
apt install -y imagemagick

echo "Installation complete."
else
if command -v magick &>/dev/null; then
echo "ImageMagick is already installed."
fi
exit 0
fi

echo "ImageMagick is not installed. Installing..."

# Update package lists and install ImageMagick
if ! apt update || ! apt install -y imagemagick; then
handle_error
fi

echo "Installation complete."

# Verify installation
if command -v magick &>/dev/null; then
echo "ImageMagick successfully installed."
exit 0
fi

echo "Failed to install ImageMagick."
exit 1
Loading

0 comments on commit 56a7bc9

Please sign in to comment.