Skip to content

Commit

Permalink
feat: add support for tar and zip archives
Browse files Browse the repository at this point in the history
  • Loading branch information
Bims-sh authored Dec 21, 2024
1 parent abc0d59 commit 31c67e7
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion bookworm/etc/entry.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,32 @@ fi
# Download and extract custom config bundle
if [[ ! -z $CS2_CFG_URL ]]; then
echo "Downloading config pack from ${CS2_CFG_URL}"
wget -qO- "${CS2_CFG_URL}" | tar xvzf - -C "${STEAMAPPDIR}"

TEMP_DIR=$(mktemp -d)
TEMP_FILE="${TEMP_DIR}/$(basename ${CS2_CFG_URL})"
wget -qO "${TEMP_FILE}" "${CS2_CFG_URL}"

case "${TEMP_FILE}" in
*.zip)
echo "Extracting ZIP file..."
unzip -q "${TEMP_FILE}" -d "${STEAMAPPDIR}"
;;
*.tar.gz | *.tgz)
echo "Extracting TAR.GZ or TGZ file..."
tar xvzf "${TEMP_FILE}" -C "${STEAMAPPDIR}"
;;
*.tar)
echo "Extracting TAR file..."
tar xvf "${TEMP_FILE}" -C "${STEAMAPPDIR}"
;;
*)
echo "Unsupported file type"
rm -rf "${TEMP_DIR}"
exit 1
;;
esac

rm -rf "${TEMP_DIR}"
fi

# Rewrite Config Files
Expand Down

0 comments on commit 31c67e7

Please sign in to comment.