#!/bin/bash ## TOOOTTALLY NOT AI GENERATED NOTHING TO SEE HERE # real note, this was because I normally program in # golang and really, *really* didnt want to have to write # and maintain a binary in a language many people dont # want to use simply because google made it... # shell scripts are typically known by docker hosters so... # Function to download a file from URL to destination download_file() { local url="$1" local destination="$2" # make sure destination directory exists mkdir -p "$(dirname "$destination")" # Use curl to download file if curl -fsSL "$url" -o "$destination"; then echo "File downloaded successfully: $destination" else echo "Failed to download file: $destination" exit 1 fi } # Download additional files from a list of URLs to /data/resonite/Headless/rml_mods # shellcheck disable=SC2153 for url in $MOD_URLS; do modname=$(basename "$url") destination="" # Determine the destination based on the file extension if [[ "$modname" == *.dll ]]; then destination="/data/resonite/Headless/rml_mods/$modname" elif [[ "$modname" == *.nupkg ]]; then destination="/data/resonite/Headless/MonkeyLoader/Mods/$modname" else echo "Unknown file type for $modname, skipping." continue fi # Check if file already exists, if yes, skip download if [ ! -f "$destination" ]; then echo "Downloading mod: $url" download_file "$url" "$destination" else echo "File already exists: $destination, skipping download." fi done # if resonte mod loader is enabled, create and link rml_mods, libs, and config if [ "$MONKEY_LOADER" == "true" ]; then for dir in rml_mods rml_libs rml_config; do if [ -d "/data/resonite/Headless/$dir" ]; then continue fi mkdir -p "/data/resonite/Headless/$dir" ln -s "./Headless/$dir" "./$dir" done fi