style: format shell scripts

This commit is contained in:
darksaid98 committed 2025-09-16 16:53:11 +02:00
1 parent 65f79fe387
commit c410367d3b
23 files changed
+355 -371

No files matched your search

+14 -14
View File
@@ -15,34 +15,34 @@ ENV USER=container HOME=/home/container
## Update base packages
RUN apt update \
&& apt upgrade -y
&& apt upgrade -y
## Install dependencies
RUN apt install -y gcc g++ libgcc-12-dev libc++-dev gdb libc6 git git-lfs wget curl tar zip unzip binutils xz-utils liblzo2-2 cabextract iproute2 net-tools netcat-traditional telnet libatomic1 libsdl1.2debian libsdl2-2.0-0 \
libfontconfig1 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadb-dev-compat libduktape207 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \
liblua5.3-0 libz3-dev libzadc4 rapidjson-dev tzdata libevent-dev libzip4 libprotobuf32 libfluidsynth3 procps libstdc++6 tini jq file
libfontconfig1 icu-devtools libunwind8 libssl-dev sqlite3 libsqlite3-dev libmariadb-dev-compat libduktape207 locales ffmpeg gnupg2 apt-transport-https software-properties-common ca-certificates \
liblua5.3-0 libz3-dev libzadc4 rapidjson-dev tzdata libevent-dev libzip4 libprotobuf32 libfluidsynth3 procps libstdc++6 tini jq file
# Temp fix for libicu66.1 for RAGE-MP and libssl1.1 for fivem and many more
RUN if [ "$(uname -m)" = "x86_64" ]; then \
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2.1_amd64.deb && \
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
dpkg -i libicu66_66.1-2ubuntu2.1_amd64.deb && \
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
rm libicu66_66.1-2ubuntu2.1_amd64.deb libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \
fi
wget http://archive.ubuntu.com/ubuntu/pool/main/i/icu/libicu66_66.1-2ubuntu2.1_amd64.deb && \
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
dpkg -i libicu66_66.1-2ubuntu2.1_amd64.deb && \
dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb && \
rm libicu66_66.1-2ubuntu2.1_amd64.deb libssl1.1_1.1.0g-2ubuntu4_amd64.deb; \
fi
# ARM64
RUN if [ ! "$(uname -m)" = "x86_64" ]; then \
wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
rm libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
fi
wget http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
dpkg -i libssl1.1_1.1.1f-1ubuntu2_arm64.deb && \
rm libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \
fi
## Configure Git Lfs
RUN git lfs install
## Configure locale
RUN update-locale lang=en_US.UTF-8 \
&& dpkg-reconfigure --frontend noninteractive locales
&& dpkg-reconfigure --frontend noninteractive locales
WORKDIR /home/container
+39 -39
View File
@@ -4,52 +4,52 @@ cd /home/container
# Auto update resources from git.
if [ "${GIT_ENABLED}" == "true" ] || [ "${GIT_ENABLED}" == "1" ]; then
# Pre git stuff
echo "Wait, preparing to pull or clone from git.";
# Pre git stuff
echo "Wait, preparing to pull or clone from git."
mkdir -p /home/container/resources
cd /home/container/resources
mkdir -p /home/container/resources
cd /home/container/resources
# Git stuff
if [[ ${GIT_REPOURL} != *.git ]]; then # Add .git at end of URL
GIT_REPOURL=${GIT_REPOURL}.git
fi
if [ -z "${GIT_USERNAME}" ] && [ -z "${GIT_TOKEN}" ]; then # Check for git username & token
echo -e "git Username or git Token was not specified."
else
GIT_REPOURL="https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo -e ${GIT_REPOURL} | cut -d/ -f3-)"
fi
if [ "$(ls -A /home/container/resources)" ]; then # Files exist in resources folder, pull
echo "Files exist in /home/container/resources/. Attempting to pull from git repository."
# Get git origin from /home/container/resources/.git/config
if [ -d .git ]; then
if [ -f .git/config ]; then
GIT_ORIGIN=$(git config --get remote.origin.url)
fi
# Git stuff
if [[ ${GIT_REPOURL} != *.git ]]; then # Add .git at end of URL
GIT_REPOURL=${GIT_REPOURL}.git
fi
# If git origin matches the repo specified by user then pull
if [ "${GIT_ORIGIN}" == "${GIT_REPOURL}" ]; then #
git pull && echo "Finished pulling /home/container/resources/ from git." || echo "Failed pulling /home/container/resources/ from git."
else
echo -e "git repository in /home/container/resources/ does not match user provided configuration. Failed pulling /home/container/resources/ from git."
fi
else # No files exist in resources folder, clone
echo -e "Resources directory is empty. Attempting to clone git repository."
if [ -z ${GIT_BRANCH} ]; then
echo -e "Cloning default branch into /home/container/resources/."
git clone ${GIT_REPOURL} .
if [ -z "${GIT_USERNAME}" ] && [ -z "${GIT_TOKEN}" ]; then # Check for git username & token
echo -e "git Username or git Token was not specified."
else
echo -e "Cloning ${GIT_BRANCH} branch into /home/container/resources/."
git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} . && echo "Finished cloning into /home/container/resources/ from git." || echo "Failed cloning into /home/container/resources/ from git."
GIT_REPOURL="https://${GIT_USERNAME}:${GIT_TOKEN}@$(echo -e ${GIT_REPOURL} | cut -d/ -f3-)"
fi
fi
# Post git stuff
cd /home/container
if [ "$(ls -A /home/container/resources)" ]; then # Files exist in resources folder, pull
echo "Files exist in /home/container/resources/. Attempting to pull from git repository."
# Get git origin from /home/container/resources/.git/config
if [ -d .git ]; then
if [ -f .git/config ]; then
GIT_ORIGIN=$(git config --get remote.origin.url)
fi
fi
# If git origin matches the repo specified by user then pull
if [ "${GIT_ORIGIN}" == "${GIT_REPOURL}" ]; then #
git pull && echo "Finished pulling /home/container/resources/ from git." || echo "Failed pulling /home/container/resources/ from git."
else
echo -e "git repository in /home/container/resources/ does not match user provided configuration. Failed pulling /home/container/resources/ from git."
fi
else # No files exist in resources folder, clone
echo -e "Resources directory is empty. Attempting to clone git repository."
if [ -z ${GIT_BRANCH} ]; then
echo -e "Cloning default branch into /home/container/resources/."
git clone ${GIT_REPOURL} .
else
echo -e "Cloning ${GIT_BRANCH} branch into /home/container/resources/."
git clone --single-branch --branch ${GIT_BRANCH} ${GIT_REPOURL} . && echo "Finished cloning into /home/container/resources/ from git." || echo "Failed cloning into /home/container/resources/ from git."
fi
fi
# Post git stuff
cd /home/container
fi
# Make internal Docker IP address available to processes.